From aa97583daa7c1fc5e30a09bfe6bfad5b2c7fb81f Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 5 Aug 2018 20:50:20 +0200 Subject: [PATCH] fix NPE --- .../nightscout/androidaps/queue/commands/CommandSetProfile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/queue/commands/CommandSetProfile.java b/app/src/main/java/info/nightscout/androidaps/queue/commands/CommandSetProfile.java index b62ef576d3..2a5e4a275a 100644 --- a/app/src/main/java/info/nightscout/androidaps/queue/commands/CommandSetProfile.java +++ b/app/src/main/java/info/nightscout/androidaps/queue/commands/CommandSetProfile.java @@ -49,7 +49,7 @@ public class CommandSetProfile extends Command { // Send SMS notification if ProfileSwitch is comming from NS ProfileSwitch profileSwitch = TreatmentsPlugin.getPlugin().getProfileSwitchFromHistory(System.currentTimeMillis()); - if (r.enacted && profileSwitch.source == Source.NIGHTSCOUT) { + if (profileSwitch != null && r.enacted && profileSwitch.source == Source.NIGHTSCOUT) { SmsCommunicatorPlugin smsCommunicatorPlugin = MainApp.getSpecificPlugin(SmsCommunicatorPlugin.class); if (smsCommunicatorPlugin != null && smsCommunicatorPlugin.isEnabled(PluginType.GENERAL)) { smsCommunicatorPlugin.sendNotificationToAllNumbers(MainApp.gs(R.string.profile_set_ok));