diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2020-09-16 13:27:36 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2020-09-16 13:27:36 -0400 |
commit | bea4e2a870eaa4a1cfecfb047966661a4e446884 (patch) | |
tree | f1e38a49113a68895f7594dcedbd254b9ca68db2 | |
parent | 5a48765845f6b3801443dcf2124e07a1d2bbd850 (diff) | |
download | sdl_ios-bea4e2a870eaa4a1cfecfb047966661a4e446884.tar.gz |
Fix a bug with setting main fields to 0 length strings
-rw-r--r-- | SmartDeviceLink/private/SDLTextAndGraphicUpdateOperation.m | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/SmartDeviceLink/private/SDLTextAndGraphicUpdateOperation.m b/SmartDeviceLink/private/SDLTextAndGraphicUpdateOperation.m index 535c1c6dd..4ff7ebd82 100644 --- a/SmartDeviceLink/private/SDLTextAndGraphicUpdateOperation.m +++ b/SmartDeviceLink/private/SDLTextAndGraphicUpdateOperation.m @@ -481,10 +481,10 @@ NS_ASSUME_NONNULL_BEGIN self.currentScreenData.secondaryGraphic = show.secondaryGraphic ? self.updatedState.secondaryGraphic : self.currentScreenData.secondaryGraphic; // This is intentionally checking `mainField1` because the fields may be in different places based on the capabilities, then check it's own field in case that's the only field thats being used. - self.currentScreenData.textField1 = (show.mainField1.length > 0) ? self.updatedState.textField1 : self.currentScreenData.textField1; - self.currentScreenData.textField2 = ((show.mainField1.length > 0) || (show.mainField2.length > 0)) ? self.updatedState.textField2 : self.currentScreenData.textField2; - self.currentScreenData.textField3 = ((show.mainField1.length > 0) || (show.mainField3.length > 0)) ? self.updatedState.textField3 : self.currentScreenData.textField3; - self.currentScreenData.textField4 = ((show.mainField1.length > 0) || (show.mainField4.length > 0)) ? self.updatedState.textField4 : self.currentScreenData.textField4; + self.currentScreenData.textField1 = show.mainField1 ? self.updatedState.textField1 : self.currentScreenData.textField1; + self.currentScreenData.textField2 = (show.mainField1 || show.mainField2) ? self.updatedState.textField2 : self.currentScreenData.textField2; + self.currentScreenData.textField3 = (show.mainField1 || show.mainField3) ? self.updatedState.textField3 : self.currentScreenData.textField3; + self.currentScreenData.textField4 = (show.mainField1 || show.mainField4) ? self.updatedState.textField4 : self.currentScreenData.textField4; // This is intentionally checking show.metadataTags.mainField1 because the tags may be in different places based on the capabilities, then check its own field in case that's the only field that's being used. self.currentScreenData.textField1Type = show.metadataTags.mainField1 ? self.updatedState.textField1Type : self.currentScreenData.textField1Type; |