summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Grover <joeygrover@gmail.com>2019-04-03 15:05:39 -0400
committerJoey Grover <joeygrover@gmail.com>2019-04-03 15:05:39 -0400
commitfceb6446cc200f980080b5dafa6889de1092c3a8 (patch)
tree32cae4cbff3d39b543edfe3c09bdedc5599c82f4
parent4fc9987d49f4bd8090186d1fd36a20903d7c2069 (diff)
downloadsdl_android-fceb6446cc200f980080b5dafa6889de1092c3a8.tar.gz
Check for null in SystemCapbility for type
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java
index 21ef7f140..38e731e9b 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java
@@ -81,7 +81,9 @@ public class SystemCapability extends RPCStruct {
}
public RPCStruct getCapabilityForType(SystemCapabilityType type) {
- if (type.equals(SystemCapabilityType.NAVIGATION)) {
+ if(type == null) {
+ return null;
+ }else if (type.equals(SystemCapabilityType.NAVIGATION)) {
return (RPCStruct) getObject(NavigationCapability.class, KEY_NAVIGATION_CAPABILITY);
} else if (type.equals(SystemCapabilityType.PHONE_CALL)) {
return (RPCStruct) getObject(PhoneCapability.class, KEY_PHONE_CAPABILITY);