Merge pull request #2572 from jotomo/insight-alert-intent-npe

InsightAlertservice: handle nullable intent.
This commit is contained in:
Milos Kozak 2020-04-19 13:06:30 +02:00 committed by GitHub
commit 6e9686ed89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -104,8 +104,10 @@ public class InsightAlertService extends Service implements InsightConnectionSer
} }
@Override @Override
public int onStartCommand(Intent intent, int flags, int startId) { public int onStartCommand(@Nullable Intent intent, int flags, int startId) {
if ("mute".equals(intent.getStringExtra("command"))) { if (intent == null) {
// service is being restarted
} else if ("mute".equals(intent.getStringExtra("command"))) {
mute(); mute();
} else if ("confirm".equals(intent.getStringExtra("command"))) { } else if ("confirm".equals(intent.getStringExtra("command"))) {
dismissNotification(); dismissNotification();