Merge "[MediaProjection] Fix NPE introduced from deadlock fix" into udc-qpr-dev
diff --git a/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java b/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java
index 61d0afe..fb3f0b3 100644
--- a/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java
+++ b/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java
@@ -260,7 +260,9 @@
         }
 
         synchronized (mLock) {
-            mProjectionGrant.stop();
+            if (mProjectionGrant != null) {
+                mProjectionGrant.stop();
+            }
         }
     }