From e17d10f25854165fe778e282cf0251df5e04a34b Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Wed, 15 Apr 2020 00:02:50 +0200 Subject: [PATCH] InsightAlertservice: handle nullable intent. --- .../plugins/pump/insight/InsightAlertService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java index 4a543f27c5..53636ef88f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java @@ -104,8 +104,10 @@ public class InsightAlertService extends Service implements InsightConnectionSer } @Override - public int onStartCommand(Intent intent, int flags, int startId) { - if ("mute".equals(intent.getStringExtra("command"))) { + public int onStartCommand(@Nullable Intent intent, int flags, int startId) { + if (intent == null) { + // service is being restarted + } else if ("mute".equals(intent.getStringExtra("command"))) { mute(); } else if ("confirm".equals(intent.getStringExtra("command"))) { dismissNotification();