summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/IpSecService.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/IpSecService.java b/services/core/java/com/android/server/IpSecService.java
index b88bbc1bdd69..2f9b8618cba6 100644
--- a/services/core/java/com/android/server/IpSecService.java
+++ b/services/core/java/com/android/server/IpSecService.java
@@ -206,7 +206,11 @@ public class IpSecService extends IIpSecService.Stub {
T get(int key) {
T val = mArray.get(key);
- val.checkOwnerOrSystemAndThrow();
+ // 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();
+ }
return val;
}