Merge "Null Pointer check on ApplicationInfo object before invoking method"

This commit is contained in:
Abhijeet Kaur
2020-02-17 17:10:50 +00:00
committed by Android (Google) Code Review

View File

@@ -4095,7 +4095,7 @@ class StorageManagerService extends IStorageManager.Stub
if (!hasLegacy && !mIsFuseEnabled) {
ApplicationInfo ai = mIPackageManager.getApplicationInfo(packageName,
0, UserHandle.getUserId(uid));
hasLegacy = ai.hasRequestedLegacyExternalStorage();
hasLegacy = (ai != null && ai.hasRequestedLegacyExternalStorage());
}
if (hasLegacy && hasWrite) {