Skip to content

Commit

Permalink
When pulling an object from an RPC, it now returns nil if the object …
Browse files Browse the repository at this point in the history
…was never set

* Fixes #75
  • Loading branch information
joeljfischer committed Jan 25, 2016
1 parent 1051267 commit 05728b0
Show file tree
Hide file tree
Showing 63 changed files with 216 additions and 216 deletions.
4 changes: 2 additions & 2 deletions SmartDeviceLink-iOS/SmartDeviceLink/SDLAddCommand.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (void)setMenuParams:(SDLMenuParams *)menuParams {

- (SDLMenuParams *)menuParams {
NSObject *obj = [parameters objectForKey:NAMES_menuParams];
if ([obj isKindOfClass:SDLMenuParams.class]) {
if (obj == nil || [obj isKindOfClass:SDLMenuParams.class]) {
return (SDLMenuParams *)obj;
} else {
return [[SDLMenuParams alloc] initWithDictionary:(NSMutableDictionary *)obj];
Expand Down Expand Up @@ -74,7 +74,7 @@ - (void)setCmdIcon:(SDLImage *)cmdIcon {

- (SDLImage *)cmdIcon {
NSObject *obj = [parameters objectForKey:NAMES_cmdIcon];
if ([obj isKindOfClass:SDLImage.class]) {
if (obj == nil || [obj isKindOfClass:SDLImage.class]) {
return (SDLImage *)obj;
} else {
return [[SDLImage alloc] initWithDictionary:(NSMutableDictionary *)obj];
Expand Down
16 changes: 8 additions & 8 deletions SmartDeviceLink-iOS/SmartDeviceLink/SDLAirbagStatus.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ - (void)setDriverAirbagDeployed:(SDLVehicleDataEventStatus *)driverAirbagDeploye

- (SDLVehicleDataEventStatus *)driverAirbagDeployed {
NSObject *obj = [store objectForKey:NAMES_driverAirbagDeployed];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -47,7 +47,7 @@ - (void)setDriverSideAirbagDeployed:(SDLVehicleDataEventStatus *)driverSideAirba

- (SDLVehicleDataEventStatus *)driverSideAirbagDeployed {
NSObject *obj = [store objectForKey:NAMES_driverSideAirbagDeployed];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -64,7 +64,7 @@ - (void)setDriverCurtainAirbagDeployed:(SDLVehicleDataEventStatus *)driverCurtai

- (SDLVehicleDataEventStatus *)driverCurtainAirbagDeployed {
NSObject *obj = [store objectForKey:NAMES_driverCurtainAirbagDeployed];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -81,7 +81,7 @@ - (void)setPassengerAirbagDeployed:(SDLVehicleDataEventStatus *)passengerAirbagD

- (SDLVehicleDataEventStatus *)passengerAirbagDeployed {
NSObject *obj = [store objectForKey:NAMES_passengerAirbagDeployed];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -98,7 +98,7 @@ - (void)setPassengerCurtainAirbagDeployed:(SDLVehicleDataEventStatus *)passenger

- (SDLVehicleDataEventStatus *)passengerCurtainAirbagDeployed {
NSObject *obj = [store objectForKey:NAMES_passengerCurtainAirbagDeployed];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -115,7 +115,7 @@ - (void)setDriverKneeAirbagDeployed:(SDLVehicleDataEventStatus *)driverKneeAirba

- (SDLVehicleDataEventStatus *)driverKneeAirbagDeployed {
NSObject *obj = [store objectForKey:NAMES_driverKneeAirbagDeployed];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -132,7 +132,7 @@ - (void)setPassengerSideAirbagDeployed:(SDLVehicleDataEventStatus *)passengerSid

- (SDLVehicleDataEventStatus *)passengerSideAirbagDeployed {
NSObject *obj = [store objectForKey:NAMES_passengerSideAirbagDeployed];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -149,7 +149,7 @@ - (void)setPassengerKneeAirbagDeployed:(SDLVehicleDataEventStatus *)passengerKne

- (SDLVehicleDataEventStatus *)passengerKneeAirbagDeployed {
NSObject *obj = [store objectForKey:NAMES_passengerKneeAirbagDeployed];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ - (void)setSamplingRate:(SDLSamplingRate *)samplingRate {

- (SDLSamplingRate *)samplingRate {
NSObject *obj = [store objectForKey:NAMES_samplingRate];
if ([obj isKindOfClass:SDLSamplingRate.class]) {
if (obj == nil || [obj isKindOfClass:SDLSamplingRate.class]) {
return (SDLSamplingRate *)obj;
} else {
return [SDLSamplingRate valueOf:(NSString *)obj];
Expand All @@ -51,7 +51,7 @@ - (void)setBitsPerSample:(SDLBitsPerSample *)bitsPerSample {

- (SDLBitsPerSample *)bitsPerSample {
NSObject *obj = [store objectForKey:NAMES_bitsPerSample];
if ([obj isKindOfClass:SDLBitsPerSample.class]) {
if (obj == nil || [obj isKindOfClass:SDLBitsPerSample.class]) {
return (SDLBitsPerSample *)obj;
} else {
return [SDLBitsPerSample valueOf:(NSString *)obj];
Expand All @@ -68,7 +68,7 @@ - (void)setAudioType:(SDLAudioType *)audioType {

- (SDLAudioType *)audioType {
NSObject *obj = [store objectForKey:NAMES_audioType];
if ([obj isKindOfClass:SDLAudioType.class]) {
if (obj == nil || [obj isKindOfClass:SDLAudioType.class]) {
return (SDLAudioType *)obj;
} else {
return [SDLAudioType valueOf:(NSString *)obj];
Expand Down
30 changes: 15 additions & 15 deletions SmartDeviceLink-iOS/SmartDeviceLink/SDLBeltStatus.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ - (void)setDriverBeltDeployed:(SDLVehicleDataEventStatus *)driverBeltDeployed {

- (SDLVehicleDataEventStatus *)driverBeltDeployed {
NSObject *obj = [store objectForKey:NAMES_driverBeltDeployed];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -48,7 +48,7 @@ - (void)setPassengerBeltDeployed:(SDLVehicleDataEventStatus *)passengerBeltDeplo

- (SDLVehicleDataEventStatus *)passengerBeltDeployed {
NSObject *obj = [store objectForKey:NAMES_passengerBeltDeployed];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -65,7 +65,7 @@ - (void)setPassengerBuckleBelted:(SDLVehicleDataEventStatus *)passengerBuckleBel

- (SDLVehicleDataEventStatus *)passengerBuckleBelted {
NSObject *obj = [store objectForKey:NAMES_passengerBuckleBelted];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -82,7 +82,7 @@ - (void)setDriverBuckleBelted:(SDLVehicleDataEventStatus *)driverBuckleBelted {

- (SDLVehicleDataEventStatus *)driverBuckleBelted {
NSObject *obj = [store objectForKey:NAMES_driverBuckleBelted];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -99,7 +99,7 @@ - (void)setLeftRow2BuckleBelted:(SDLVehicleDataEventStatus *)leftRow2BuckleBelte

- (SDLVehicleDataEventStatus *)leftRow2BuckleBelted {
NSObject *obj = [store objectForKey:NAMES_leftRow2BuckleBelted];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -116,7 +116,7 @@ - (void)setPassengerChildDetected:(SDLVehicleDataEventStatus *)passengerChildDet

- (SDLVehicleDataEventStatus *)passengerChildDetected {
NSObject *obj = [store objectForKey:NAMES_passengerChildDetected];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -133,7 +133,7 @@ - (void)setRightRow2BuckleBelted:(SDLVehicleDataEventStatus *)rightRow2BuckleBel

- (SDLVehicleDataEventStatus *)rightRow2BuckleBelted {
NSObject *obj = [store objectForKey:NAMES_rightRow2BuckleBelted];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -150,7 +150,7 @@ - (void)setMiddleRow2BuckleBelted:(SDLVehicleDataEventStatus *)middleRow2BuckleB

- (SDLVehicleDataEventStatus *)middleRow2BuckleBelted {
NSObject *obj = [store objectForKey:NAMES_middleRow2BuckleBelted];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -167,7 +167,7 @@ - (void)setMiddleRow3BuckleBelted:(SDLVehicleDataEventStatus *)middleRow3BuckleB

- (SDLVehicleDataEventStatus *)middleRow3BuckleBelted {
NSObject *obj = [store objectForKey:NAMES_middleRow3BuckleBelted];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -184,7 +184,7 @@ - (void)setLeftRow3BuckleBelted:(SDLVehicleDataEventStatus *)leftRow3BuckleBelte

- (SDLVehicleDataEventStatus *)leftRow3BuckleBelted {
NSObject *obj = [store objectForKey:NAMES_leftRow3BuckleBelted];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -201,7 +201,7 @@ - (void)setRightRow3BuckleBelted:(SDLVehicleDataEventStatus *)rightRow3BuckleBel

- (SDLVehicleDataEventStatus *)rightRow3BuckleBelted {
NSObject *obj = [store objectForKey:NAMES_rightRow3BuckleBelted];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -218,7 +218,7 @@ - (void)setLeftRearInflatableBelted:(SDLVehicleDataEventStatus *)leftRearInflata

- (SDLVehicleDataEventStatus *)leftRearInflatableBelted {
NSObject *obj = [store objectForKey:NAMES_leftRearInflatableBelted];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -235,7 +235,7 @@ - (void)setRightRearInflatableBelted:(SDLVehicleDataEventStatus *)rightRearInfla

- (SDLVehicleDataEventStatus *)rightRearInflatableBelted {
NSObject *obj = [store objectForKey:NAMES_rightRearInflatableBelted];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -252,7 +252,7 @@ - (void)setMiddleRow1BeltDeployed:(SDLVehicleDataEventStatus *)middleRow1BeltDep

- (SDLVehicleDataEventStatus *)middleRow1BeltDeployed {
NSObject *obj = [store objectForKey:NAMES_middleRow1BeltDeployed];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand All @@ -269,7 +269,7 @@ - (void)setMiddleRow1BuckleBelted:(SDLVehicleDataEventStatus *)middleRow1BuckleB

- (SDLVehicleDataEventStatus *)middleRow1BuckleBelted {
NSObject *obj = [store objectForKey:NAMES_middleRow1BuckleBelted];
if ([obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataEventStatus.class]) {
return (SDLVehicleDataEventStatus *)obj;
} else {
return [SDLVehicleDataEventStatus valueOf:(NSString *)obj];
Expand Down
4 changes: 2 additions & 2 deletions SmartDeviceLink-iOS/SmartDeviceLink/SDLBodyInformation.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (void)setIgnitionStableStatus:(SDLIgnitionStableStatus *)ignitionStableStatus

- (SDLIgnitionStableStatus *)ignitionStableStatus {
NSObject *obj = [store objectForKey:NAMES_ignitionStableStatus];
if ([obj isKindOfClass:SDLIgnitionStableStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLIgnitionStableStatus.class]) {
return (SDLIgnitionStableStatus *)obj;
} else {
return [SDLIgnitionStableStatus valueOf:(NSString *)obj];
Expand All @@ -62,7 +62,7 @@ - (void)setIgnitionStatus:(SDLIgnitionStatus *)ignitionStatus {

- (SDLIgnitionStatus *)ignitionStatus {
NSObject *obj = [store objectForKey:NAMES_ignitionStatus];
if ([obj isKindOfClass:SDLIgnitionStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLIgnitionStatus.class]) {
return (SDLIgnitionStatus *)obj;
} else {
return [SDLIgnitionStatus valueOf:(NSString *)obj];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ - (void)setName:(SDLButtonName *)name {

- (SDLButtonName *)name {
NSObject *obj = [store objectForKey:NAMES_name];
if ([obj isKindOfClass:SDLButtonName.class]) {
if (obj == nil || [obj isKindOfClass:SDLButtonName.class]) {
return (SDLButtonName *)obj;
} else {
return [SDLButtonName valueOf:(NSString *)obj];
Expand Down
4 changes: 2 additions & 2 deletions SmartDeviceLink-iOS/SmartDeviceLink/SDLChangeRegistration.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ - (void)setLanguage:(SDLLanguage *)language {

- (SDLLanguage *)language {
NSObject *obj = [parameters objectForKey:NAMES_language];
if ([obj isKindOfClass:SDLLanguage.class]) {
if (obj == nil || [obj isKindOfClass:SDLLanguage.class]) {
return (SDLLanguage *)obj;
} else {
return [SDLLanguage valueOf:(NSString *)obj];
Expand All @@ -48,7 +48,7 @@ - (void)setHmiDisplayLanguage:(SDLLanguage *)hmiDisplayLanguage {

- (SDLLanguage *)hmiDisplayLanguage {
NSObject *obj = [parameters objectForKey:NAMES_hmiDisplayLanguage];
if ([obj isKindOfClass:SDLLanguage.class]) {
if (obj == nil || [obj isKindOfClass:SDLLanguage.class]) {
return (SDLLanguage *)obj;
} else {
return [SDLLanguage valueOf:(NSString *)obj];
Expand Down
4 changes: 2 additions & 2 deletions SmartDeviceLink-iOS/SmartDeviceLink/SDLChoice.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ - (void)setImage:(SDLImage *)image {

- (SDLImage *)image {
NSObject *obj = [store objectForKey:NAMES_image];
if ([obj isKindOfClass:SDLImage.class]) {
if (obj == nil || [obj isKindOfClass:SDLImage.class]) {
return (SDLImage *)obj;
} else {
return [[SDLImage alloc] initWithDictionary:(NSMutableDictionary *)obj];
Expand Down Expand Up @@ -108,7 +108,7 @@ - (void)setSecondaryImage:(SDLImage *)secondaryImage {

- (SDLImage *)secondaryImage {
NSObject *obj = [store objectForKey:NAMES_secondaryImage];
if ([obj isKindOfClass:SDLImage.class]) {
if (obj == nil || [obj isKindOfClass:SDLImage.class]) {
return (SDLImage *)obj;
} else {
return [[SDLImage alloc] initWithDictionary:(NSMutableDictionary *)obj];
Expand Down
6 changes: 3 additions & 3 deletions SmartDeviceLink-iOS/SmartDeviceLink/SDLClusterModeStatus.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (void)setPowerModeQualificationStatus:(SDLPowerModeQualificationStatus *)power

- (SDLPowerModeQualificationStatus *)powerModeQualificationStatus {
NSObject *obj = [store objectForKey:NAMES_powerModeQualificationStatus];
if ([obj isKindOfClass:SDLPowerModeQualificationStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLPowerModeQualificationStatus.class]) {
return (SDLPowerModeQualificationStatus *)obj;
} else {
return [SDLPowerModeQualificationStatus valueOf:(NSString *)obj];
Expand All @@ -62,7 +62,7 @@ - (void)setCarModeStatus:(SDLCarModeStatus *)carModeStatus {

- (SDLCarModeStatus *)carModeStatus {
NSObject *obj = [store objectForKey:NAMES_carModeStatus];
if ([obj isKindOfClass:SDLCarModeStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLCarModeStatus.class]) {
return (SDLCarModeStatus *)obj;
} else {
return [SDLCarModeStatus valueOf:(NSString *)obj];
Expand All @@ -79,7 +79,7 @@ - (void)setPowerModeStatus:(SDLPowerModeStatus *)powerModeStatus {

- (SDLPowerModeStatus *)powerModeStatus {
NSObject *obj = [store objectForKey:NAMES_powerModeStatus];
if ([obj isKindOfClass:SDLPowerModeStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLPowerModeStatus.class]) {
return (SDLPowerModeStatus *)obj;
} else {
return [SDLPowerModeStatus valueOf:(NSString *)obj];
Expand Down
2 changes: 1 addition & 1 deletion SmartDeviceLink-iOS/SmartDeviceLink/SDLConsoleController.m
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
id obj = [currentDictionary objectForKey:@"object"];

NSString *alertText = nil;
if ([obj isKindOfClass:SDLRPCMessage.class]) {
if (obj == nil || [obj isKindOfClass:SDLRPCMessage.class]) {
SDLRPCMessage *rpc = obj;
NSDictionary *dictionary = [rpc serializeAsDictionary:2];
NSError *error = nil;
Expand Down
2 changes: 1 addition & 1 deletion SmartDeviceLink-iOS/SmartDeviceLink/SDLDIDResult.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ - (void)setResultCode:(SDLVehicleDataResultCode *)resultCode {

- (SDLVehicleDataResultCode *)resultCode {
NSObject *obj = [store objectForKey:NAMES_resultCode];
if ([obj isKindOfClass:SDLVehicleDataResultCode.class]) {
if (obj == nil || [obj isKindOfClass:SDLVehicleDataResultCode.class]) {
return (SDLVehicleDataResultCode *)obj;
} else {
return [SDLVehicleDataResultCode valueOf:(NSString *)obj];
Expand Down
6 changes: 3 additions & 3 deletions SmartDeviceLink-iOS/SmartDeviceLink/SDLDeviceStatus.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ - (void)setBattLevelStatus:(SDLDeviceLevelStatus *)battLevelStatus {

- (SDLDeviceLevelStatus *)battLevelStatus {
NSObject *obj = [store objectForKey:NAMES_battLevelStatus];
if ([obj isKindOfClass:SDLDeviceLevelStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLDeviceLevelStatus.class]) {
return (SDLDeviceLevelStatus *)obj;
} else {
return [SDLDeviceLevelStatus valueOf:(NSString *)obj];
Expand Down Expand Up @@ -133,7 +133,7 @@ - (void)setSignalLevelStatus:(SDLDeviceLevelStatus *)signalLevelStatus {

- (SDLDeviceLevelStatus *)signalLevelStatus {
NSObject *obj = [store objectForKey:NAMES_signalLevelStatus];
if ([obj isKindOfClass:SDLDeviceLevelStatus.class]) {
if (obj == nil || [obj isKindOfClass:SDLDeviceLevelStatus.class]) {
return (SDLDeviceLevelStatus *)obj;
} else {
return [SDLDeviceLevelStatus valueOf:(NSString *)obj];
Expand All @@ -150,7 +150,7 @@ - (void)setPrimaryAudioSource:(SDLPrimaryAudioSource *)primaryAudioSource {

- (SDLPrimaryAudioSource *)primaryAudioSource {
NSObject *obj = [store objectForKey:NAMES_primaryAudioSource];
if ([obj isKindOfClass:SDLPrimaryAudioSource.class]) {
if (obj == nil || [obj isKindOfClass:SDLPrimaryAudioSource.class]) {
return (SDLPrimaryAudioSource *)obj;
} else {
return [SDLPrimaryAudioSource valueOf:(NSString *)obj];
Expand Down

0 comments on commit 05728b0

Please sign in to comment.