Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59eac4b5 authored by Christopher Tate's avatar Christopher Tate
Browse files

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
parent 232f24e9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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