We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa07dc0 commit d07c28fCopy full SHA for d07c28f
src/android/org/stereolux/cordova/serial/Serial.java
@@ -234,7 +234,9 @@ private void closeSerial(final CallbackContext callbackContext) {
234
cordova.getThreadPool().execute(new Runnable() {
235
public void run() {
236
try {
237
- port.close();
+ // Make sure we don't die if we try to close an non-existing port!
238
+ if (port != null)
239
+ port.close();
240
callbackContext.success();
241
} catch (IOException e) {
242
// deal with error
0 commit comments