From 61aae81d098f7a34bd915e3fa4899dafc1bd4e2c Mon Sep 17 00:00:00 2001 From: TebbeUbben Date: Thu, 22 Mar 2018 01:22:18 +0100 Subject: [PATCH] Fix for NullPointerException --- .../java/sugar/free/sightparser/handling/SightService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sightparser/src/main/java/sugar/free/sightparser/handling/SightService.java b/sightparser/src/main/java/sugar/free/sightparser/handling/SightService.java index 8ab925f..879fc87 100644 --- a/sightparser/src/main/java/sugar/free/sightparser/handling/SightService.java +++ b/sightparser/src/main/java/sugar/free/sightparser/handling/SightService.java @@ -255,9 +255,10 @@ public void reset() throws RemoteException { @Override public void aclDisconnect(String mac) throws RemoteException { if (verifyAdminCaller("aclDisconnect")) { + if (bluetoothSocket == null) return; if (getDataStorage().get("DEVICEMAC").equalsIgnoreCase(mac)) { try { - if (bluetoothSocket != null && bluetoothSocket.isConnected()) { + if (bluetoothSocket.isConnected()) { Log.d("SightService", "Received ACL disconnect, closing socket..."); bluetoothSocket.close(); }