diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaConnection.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaConnection.java index 8cfb26ab51..3a5fa51618 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaConnection.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaConnection.java @@ -134,7 +134,7 @@ public class DanaConnection { String action = intent.getAction(); if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action)) { log.debug("Device has disconnected " + device.getName());//Device has disconnected - if (mDevice.getName().equals(device.getName())) { + if (mDevice != null && mDevice.getName().equals(device.getName())) { if (mRfcommSocket != null) { try { mInputStream.close();