Merge changes from topic "presubmit-am-b5e39839c1434267a07590be6e0b1b91" into sc-v2-dev-plus-aosp

* changes:
  [automerge] Fix NPE 2p: 18179a8762
  Fix NPE
This commit is contained in:
Songchun Fan
2022-04-06 00:35:03 +00:00
committed by Android (Google) Code Review

View File

@@ -394,7 +394,10 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
// Their staging dirs will be removed too
PackageInstallerSession root = !session.hasParentSessionId()
? session : mSessions.get(session.getParentSessionId());
if (!root.isDestroyed()) {
if (root == null) {
Slog.e(TAG, "freeStageDirs: found an orphaned session: "
+ session.sessionId + " parent=" + session.getParentSessionId());
} else if (!root.isDestroyed()) {
root.abandon();
}
} else {