We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23086d6 commit 9916634Copy full SHA for 9916634
app/src/processing/app/Serial.java
@@ -185,8 +185,11 @@ public synchronized void serialEvent(SerialPortEvent serialEvent) {
185
case SerialPortEvent.RXFLAG:
186
try {
187
byte[] bytes = port.readBytes();
188
+ if (bytes == null) {
189
+ return;
190
+ }
191
String bytesAsString = new String(bytes);
- if(monitor) {
192
+ if (monitor) {
193
System.out.print(bytesAsString);
194
}
195
if (this.consumer != null) {
@@ -199,7 +202,6 @@ public synchronized void serialEvent(SerialPortEvent serialEvent) {
199
202
200
203
201
204
-
205
/**
206
* This will handle both ints, bytes and chars transparently.
207
*/
0 commit comments