Fix NullPointerException.
Fix a NullPointerException that can occur if a package with a recently created rollback is no longer installed on device when the device boots. Bug: 137135842 Test: atest CtsRollbackManagerHostTestCases Change-Id: Ic007e44264647793c6271c3923c13c9e1736a9de
This commit is contained in:
@@ -1289,7 +1289,8 @@ class RollbackManagerServiceImpl extends IRollbackManager.Stub {
|
||||
|
||||
|
||||
private boolean packageVersionsEqual(VersionedPackage a, VersionedPackage b) {
|
||||
return a.getPackageName().equals(b.getPackageName())
|
||||
return a != null && b != null
|
||||
&& a.getPackageName().equals(b.getPackageName())
|
||||
&& a.getLongVersionCode() == b.getLongVersionCode();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user