Check ManagedResource is NonNull before Checking Owner
If an invalid Resource Id is provided to the Managed Resource Array getter, we should just return null rather than asserting the owner of the resource. Bug: none Test: tbd Change-Id: I407a96e4e82e9d6bf68e89380a88d3851efe4305
This commit is contained in:
@@ -206,7 +206,11 @@ public class IpSecService extends IIpSecService.Stub {
|
|||||||
|
|
||||||
T get(int key) {
|
T get(int key) {
|
||||||
T val = mArray.get(key);
|
T val = mArray.get(key);
|
||||||
|
// The value should never be null unless the resource doesn't exist
|
||||||
|
// (since we do not allow null resources to be added).
|
||||||
|
if (val != null) {
|
||||||
val.checkOwnerOrSystemAndThrow();
|
val.checkOwnerOrSystemAndThrow();
|
||||||
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user