Merge "Check ManagedResource is NonNull before Checking Owner"

This commit is contained in:
nharold
2017-07-17 16:57:01 +00:00
committed by Gerrit Code Review

View File

@@ -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;
} }