Merge "[MediaProjection] Fix NPE introduced from deadlock fix" into udc-qpr-dev am: c7f44afca9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24224363

Change-Id: Id9595e11a596ed3a34acfacfaf9088f52d99ca8c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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();
+            }
         }
     }