OSDN Git Service

Avoid NPE
authorMarcos Marado <mmarado@cyngn.com>
Fri, 23 Sep 2016 16:29:38 +0000 (17:29 +0100)
committerArvin Quilao <arquilao@gmail.com>
Mon, 3 Oct 2016 01:19:02 +0000 (18:19 -0700)
Change-Id: Ib6a44e2f2ee023992ce3539a9aa1b7ed0be9d3ef

src/com/cyanogenmod/eleven/MusicPlaybackService.java

index 9a064d1..13aa01c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2012 Andrew Neal
- * Copyright (C) 2014 The CyanogenMod Project
+ * Copyright (C) 2014-2016 The CyanogenMod Project
  * Licensed under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with the
  * License. You may obtain a copy of the License at
@@ -2500,6 +2500,7 @@ public class MusicPlaybackService extends Service {
      * Temporarily pauses playback.
      */
     public void pause() {
+        if (mPlayerHandler == null) return;
         if (D) Log.d(TAG, "Pausing playback");
         synchronized (this) {
             if (mPlayerHandler != null) {