summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2010-02-19 19:25:45 -0800
committerChristopher Tate <ctate@google.com>2010-02-19 19:25:45 -0800
commit59eac4b535adad485bffcfb07ae4b734168fc2e6 (patch)
treeb29a765e94fa7ab81b0fa52e8791557c35d90cc9 /services
parent232f24e9c12a19cbbef304fb6ffc108d1334a800 (diff)
downloadframeworks_base-59eac4b535adad485bffcfb07ae4b734168fc2e6.zip
frameworks_base-59eac4b535adad485bffcfb07ae4b734168fc2e6.tar.gz
frameworks_base-59eac4b535adad485bffcfb07ae4b734168fc2e6.tar.bz2
Fix crash: check for install failure cleanly
Don't go looking at attributes of a package struct without first verifying that the struct pointer is non-null: in the failed-install case, of course there will be no package info. Change-Id: I3b2cafca2f1e3891a6592825ce5bcc977e7f3483
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/PackageManagerService.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index 90a606d..38d8615 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -4344,7 +4344,9 @@ class PackageManagerService extends IPackageManager.Stub {
// succeeded, (b) the operation is not an update, and (c) the new
// package has a backupAgent defined.
final boolean update = res.removedInfo.removedPackage != null;
- boolean doRestore = (!update && res.pkg.applicationInfo.backupAgentName != null);
+ boolean doRestore = (!update
+ && res.pkg != null
+ && res.pkg.applicationInfo.backupAgentName != null);
// Set up the post-install work request bookkeeping. This will be used
// and cleaned up by the post-install event handling regardless of whether