Fixed NPE when RXCHAR event with no bytes. Closes #1885

This commit is contained in:
Federico Fissore 2014-02-21 11:14:30 +01:00
parent c39a6a26da
commit 79eb32f816
2 changed files with 6 additions and 1 deletions

View File

@ -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];

View File

@ -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]