diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java index c9ba988000e04..30ed26274770b 100644 --- a/services/core/java/com/android/server/StorageManagerService.java +++ b/services/core/java/com/android/server/StorageManagerService.java @@ -3973,7 +3973,7 @@ class StorageManagerService extends IStorageManager.Stub if (mIsFuseEnabled && hasMtp) { ApplicationInfo ai = mIPackageManager.getApplicationInfo(packageName, 0, UserHandle.getUserId(uid)); - if (ai.isSignedWithPlatformKey()) { + if (ai != null && ai.isSignedWithPlatformKey()) { // Platform processes hosting the MTP server should be able to write in Android/ return Zygote.MOUNT_EXTERNAL_ANDROID_WRITABLE; }