From 9ee9274e5ebd131cef02d543fdb5cd1c1ae9a9f6 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Wed, 1 Sep 2010 13:40:57 -0700 Subject: [PATCH] Add null check for package settings A few lines down "ps" is run through a null check, so apparently there could be some screwy system conditions where this is encountered. And, in fact, this was encountered through an updated system pacakge that managed to delete the package from /system/app during testing. It left the PackageSetting in mDisabledSysPackages which would cause a deference of a null variable. Change-Id: Ic7faca569abd16a87a8a69c20df08c11a274a001 --- services/java/com/android/server/PackageManagerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java index abf8b7cbf998c..387f458a7106f 100644 --- a/services/java/com/android/server/PackageManagerService.java +++ b/services/java/com/android/server/PackageManagerService.java @@ -2603,7 +2603,7 @@ class PackageManagerService extends IPackageManager.Stub { } // First check if this is a system package that may involve an update if (updatedPkg != null && (parseFlags&PackageParser.PARSE_IS_SYSTEM) != 0) { - if (!ps.codePath.equals(scanFile)) { + if (ps != null && !ps.codePath.equals(scanFile)) { // The path has changed from what was last scanned... check the // version of the new path against what we have stored to determine // what to do.