diff --git a/android/app/src/main/java/org/musicpd/Main.java b/android/app/src/main/java/org/musicpd/Main.java index 3c4ad5464..5f440b964 100644 --- a/android/app/src/main/java/org/musicpd/Main.java +++ b/android/app/src/main/java/org/musicpd/Main.java @@ -133,11 +133,11 @@ public class Main extends Service implements Runnable { @Override public int onStartCommand(Intent intent, int flags, int startId) { - if (Objects.equals(intent.getAction(), SHUTDOWN_ACTION)) { + if (intent != null && Objects.equals(intent.getAction(), SHUTDOWN_ACTION)) { stop(); } else { start(); - if (intent.getBooleanExtra("wakelock", false)) + if (intent != null && intent.getBooleanExtra("wakelock", false)) setWakelockEnabled(true); } return START_STICKY;