Skip to content

Commit 79eb32f

Browse files
author
Federico Fissore
committed
Fixed NPE when RXCHAR event with no bytes. Closes #1885
1 parent c39a6a2 commit 79eb32f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

app/src/processing/app/Serial.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public void addListener(MessageConsumer consumer) {
175175
public synchronized void serialEvent(SerialPortEvent serialEvent) {
176176
if (serialEvent.isRXCHAR()) {
177177
try {
178-
byte[] buf = port.readBytes();
178+
byte[] buf = port.readBytes(serialEvent.getEventValue());
179179
if (buf.length > 0) {
180180
if (bufferLast == buffer.length) {
181181
byte temp[] = new byte[bufferLast << 1];

build/shared/revisions.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11

2+
ARDUINO 1.5.6-r2 BETA 2014.02.21
3+
4+
[ide]
5+
* JSSC: Fixed NPE when RXCHAR event with no bytes (José Pereda)
6+
27
ARDUINO 1.5.6 BETA 2014.02.20
38

49
[ide]

0 commit comments

Comments
 (0)