diff options
author | Julian Kast <julian@livio.com> | 2020-07-29 21:01:02 -0400 |
---|---|---|
committer | Julian Kast <julian@livio.com> | 2020-07-29 21:01:02 -0400 |
commit | 36dbbf81978f1b95648b2432f2b2c37773119c73 (patch) | |
tree | 2bf95b7a5e88d9ec1452ede4970f7b1a5d543b6d /base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java | |
parent | 7dbab192422096795d4cc65b0b3aee81aa8b4173 (diff) | |
download | sdl_android-36dbbf81978f1b95648b2432f2b2c37773119c73.tar.gz |
Added null check for isDriverDistractionAvailable() to match the class and pass unit test.
Diffstat (limited to 'base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java')
-rw-r--r-- | base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java index b9ae6a7ec..73c81c924 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java @@ -150,7 +150,11 @@ public class HMICapabilities extends RPCStruct{ * @return Boolean Availability of driver distraction capability. True: Available, False: Not Available * @since SmartDeviceLink 7.0.0 */ - public Boolean isDriverDistractionAvailable() { - return getBoolean(KEY_DRIVER_DISTRACTION); - } + public Boolean isDriverDistractionAvailable() { + Object available = getValue(KEY_DRIVER_DISTRACTION); + if (available == null) { + return false; + } + return (Boolean) available; + } } |