diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2019-08-08 14:17:07 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2019-08-08 14:17:07 -0400 |
commit | 9e3ecd184ab60eebb954c6f649a4889141bc9087 (patch) | |
tree | 149fe328cd9409e12c2204ab557c48cf9a5dc3aa | |
parent | f0e6c968a2ac0ba47c36b192eb42655d2f358d46 (diff) | |
download | sdl_ios-9e3ecd184ab60eebb954c6f649a4889141bc9087.tar.gz |
Don't try to transition SoftButtonObject if there's only one statebugfix/issue_1375_softbuttonobject_single_state_initializer
-rw-r--r-- | SmartDeviceLink/SDLSoftButtonObject.m | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLSoftButtonObject.m b/SmartDeviceLink/SDLSoftButtonObject.m index 3d74c168a..adb153e1a 100644 --- a/SmartDeviceLink/SDLSoftButtonObject.m +++ b/SmartDeviceLink/SDLSoftButtonObject.m @@ -64,6 +64,11 @@ NS_ASSUME_NONNULL_BEGIN return NO; } + if (self.states.count == 1) { + SDLLogW(@"There's only one state, so no transitioning is possible!"); + return NO; + } + SDLLogD(@"Transitioning button %@ to state %@", self.name, stateName); self.currentStateName = stateName; [self.manager sdl_transitionSoftButton:self]; |