mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
Fixed NPE when RXCHAR event with no bytes. Closes #1885
This commit is contained in:
@ -175,7 +175,7 @@ public class Serial implements SerialPortEventListener {
|
|||||||
public synchronized void serialEvent(SerialPortEvent serialEvent) {
|
public synchronized void serialEvent(SerialPortEvent serialEvent) {
|
||||||
if (serialEvent.isRXCHAR()) {
|
if (serialEvent.isRXCHAR()) {
|
||||||
try {
|
try {
|
||||||
byte[] buf = port.readBytes();
|
byte[] buf = port.readBytes(serialEvent.getEventValue());
|
||||||
if (buf.length > 0) {
|
if (buf.length > 0) {
|
||||||
if (bufferLast == buffer.length) {
|
if (bufferLast == buffer.length) {
|
||||||
byte temp[] = new byte[bufferLast << 1];
|
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
|
ARDUINO 1.5.6 BETA 2014.02.20
|
||||||
|
|
||||||
[ide]
|
[ide]
|
||||||
|
Reference in New Issue
Block a user