From 5c70b3fc6d363f43abd5786bbf91c94c58f0a9c8 Mon Sep 17 00:00:00 2001 From: Sathiskumar Palaniappan Date: Thu, 6 Apr 2017 15:16:03 +0530 Subject: [PATCH 1/2] Fix NPE in terminate call --- .../java/com/ibm/iotf/devicemgmt/device/ManagedDevice.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ibm/iotf/devicemgmt/device/ManagedDevice.java b/src/main/java/com/ibm/iotf/devicemgmt/device/ManagedDevice.java index b84c236e..a8030de6 100644 --- a/src/main/java/com/ibm/iotf/devicemgmt/device/ManagedDevice.java +++ b/src/main/java/com/ibm/iotf/devicemgmt/device/ManagedDevice.java @@ -1025,7 +1025,9 @@ public void run() { private void terminate() { running = false; try { - publishQueue.put(dummy); + if(publishQueue != null) { + publishQueue.put(dummy); + } } catch (InterruptedException e) { } } From 6ca9975c8dcc866bfdba24766f71a2602501ab7c Mon Sep 17 00:00:00 2001 From: Sathiskumar Palaniappan Date: Thu, 6 Apr 2017 15:17:17 +0530 Subject: [PATCH 2/2] Fix NPE in terminate call --- .../java/com/ibm/iotf/devicemgmt/gateway/ManagedGateway.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ibm/iotf/devicemgmt/gateway/ManagedGateway.java b/src/main/java/com/ibm/iotf/devicemgmt/gateway/ManagedGateway.java index 7a0cac3e..a2770432 100644 --- a/src/main/java/com/ibm/iotf/devicemgmt/gateway/ManagedGateway.java +++ b/src/main/java/com/ibm/iotf/devicemgmt/gateway/ManagedGateway.java @@ -1599,7 +1599,9 @@ public void run() { private void terminate() { running = false; try { - publishQueue.put(dummy); + if(null != publishQueue) { + publishQueue.put(dummy); + } } catch (InterruptedException e) { } }