From 412c771d595f15dcd166869f6eaffdba15685534 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Mon, 20 Apr 2015 20:48:52 +0200 Subject: [PATCH] fix crash --- .../nodomain/freeyourgadget/gadgetbridge/ControlCenter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java index 3dc9f53d..ee71bfc4 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java @@ -185,7 +185,7 @@ public class ControlCenter extends Activity { SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); String miAddr = sharedPrefs.getString("development_miaddr", null); - if (miAddr != null && !miAddr.equals("") && !miAddr.equals(connectedDevice.getAddress())) { + if (miAddr != null && !miAddr.equals("") && (connectedDevice == null || !miAddr.equals(connectedDevice.getAddress()))) { deviceList.add(new GBDevice(miAddr, "MI", GBDevice.Type.MIBAND)); }