diff options
author | Joey Grover <joeygrover@gmail.com> | 2019-04-03 15:05:39 -0400 |
---|---|---|
committer | Joey Grover <joeygrover@gmail.com> | 2019-04-03 15:05:39 -0400 |
commit | fceb6446cc200f980080b5dafa6889de1092c3a8 (patch) | |
tree | 32cae4cbff3d39b543edfe3c09bdedc5599c82f4 | |
parent | 4fc9987d49f4bd8090186d1fd36a20903d7c2069 (diff) | |
download | sdl_android-fceb6446cc200f980080b5dafa6889de1092c3a8.tar.gz |
Check for null in SystemCapbility for type
-rw-r--r-- | base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java | 4 |
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); |