summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2019-08-08 14:17:07 -0400
committerJoel Fischer <joeljfischer@gmail.com>2019-08-08 14:17:07 -0400
commit9e3ecd184ab60eebb954c6f649a4889141bc9087 (patch)
tree149fe328cd9409e12c2204ab557c48cf9a5dc3aa
parentf0e6c968a2ac0ba47c36b192eb42655d2f358d46 (diff)
downloadsdl_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.m5
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];