Null Pointer check on ApplicationInfo object before invoking method

Test: builds
Change-Id: I53444e604b9c5eec79f824aadb4d7a8867cbef9e
This commit is contained in:
Abhijeet Kaur
2020-02-14 15:48:14 +00:00
parent 755bbc6a7a
commit 8217a65de0

View File

@@ -4030,7 +4030,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) {