summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/private/SDLChoiceSetManager.m
diff options
context:
space:
mode:
Diffstat (limited to 'SmartDeviceLink/private/SDLChoiceSetManager.m')
-rw-r--r--SmartDeviceLink/private/SDLChoiceSetManager.m11
1 files changed, 10 insertions, 1 deletions
diff --git a/SmartDeviceLink/private/SDLChoiceSetManager.m b/SmartDeviceLink/private/SDLChoiceSetManager.m
index 006cff639..ae41c39c1 100644
--- a/SmartDeviceLink/private/SDLChoiceSetManager.m
+++ b/SmartDeviceLink/private/SDLChoiceSetManager.m
@@ -222,7 +222,16 @@ UInt16 const ChoiceCellCancelIdMax = 200;
- (void)preloadChoices:(NSArray<SDLChoiceCell *> *)choices withCompletionHandler:(nullable SDLPreloadChoiceCompletionHandler)handler {
SDLLogV(@"Request to preload choices: %@", choices);
- if (choices.count == 0) { return; }
+ if (choices.count == 0) {
+ if (handler != nil) {
+ handler([NSError sdl_choiceSetManager_choiceUploadFailed:@{
+ NSLocalizedDescriptionKey: @"Choice upload failed",
+ NSLocalizedFailureReasonErrorKey: @"No choices were provided for upload",
+ NSLocalizedRecoverySuggestionErrorKey: @"Provide some choice cells to upload instead of an empty list"
+ }]);
+ }
+ return;
+ }
if (![self.currentState isEqualToString:SDLChoiceManagerStateReady]) {
NSError *error = [NSError sdl_choiceSetManager_incorrectState:self.currentState];
SDLLogE(@"Cannot preload choices when the manager isn't in the ready state: %@", error);