mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-20 14:54:31 +01:00
Fixed NPE when RXCHAR event with no bytes. Closes #1885
This commit is contained in:
parent
c39a6a26da
commit
79eb32f816
@ -175,7 +175,7 @@ public class Serial implements SerialPortEventListener {
|
||||
public synchronized void serialEvent(SerialPortEvent serialEvent) {
|
||||
if (serialEvent.isRXCHAR()) {
|
||||
try {
|
||||
byte[] buf = port.readBytes();
|
||||
byte[] buf = port.readBytes(serialEvent.getEventValue());
|
||||
if (buf.length > 0) {
|
||||
if (bufferLast == buffer.length) {
|
||||
byte temp[] = new byte[bufferLast << 1];
|
||||
|
@ -1,4 +1,9 @@
|
||||
|
||||
ARDUINO 1.5.6-r2 BETA 2014.02.21
|
||||
|
||||
[ide]
|
||||
* JSSC: Fixed NPE when RXCHAR event with no bytes (José Pereda)
|
||||
|
||||
ARDUINO 1.5.6 BETA 2014.02.20
|
||||
|
||||
[ide]
|
||||
|
Loading…
x
Reference in New Issue
Block a user