From b560535c708ab62fb72549e928dba444c8e8b0ef Mon Sep 17 00:00:00 2001 From: sunxudong Date: Wed, 20 May 2020 14:53:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=81=9C=E6=AD=A2=E4=B8=B2?= =?UTF-8?q?=E5=8F=A3,bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- serial/build.gradle | 4 ++-- serial/src/main/java/org/sheedon/serial/SerialClient.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/serial/build.gradle b/serial/build.gradle index 46b7f05..d0cb832 100644 --- a/serial/build.gradle +++ b/serial/build.gradle @@ -8,8 +8,8 @@ android { defaultConfig { minSdkVersion 15 targetSdkVersion 28 - versionCode 10 - versionName "1.2.6" + versionCode 11 + versionName "1.2.7" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' diff --git a/serial/src/main/java/org/sheedon/serial/SerialClient.java b/serial/src/main/java/org/sheedon/serial/SerialClient.java index ad8005b..0e79135 100644 --- a/serial/src/main/java/org/sheedon/serial/SerialClient.java +++ b/serial/src/main/java/org/sheedon/serial/SerialClient.java @@ -79,7 +79,8 @@ public Observable newObservable(Request request) { } public void destroy() { - port.closeSerialPort(); + if (port != null) + port.closeSerialPort(); port = null; }