Skip to content

Commit

Permalink
Merge pull request #1924 from smartdevicelink/bugfix/issue-1923-empty…
Browse files Browse the repository at this point in the history
…-string-bug-with-menu-cell

Fixed empty string bug in Menu Cell texts
  • Loading branch information
joeljfischer authored Mar 2, 2021
2 parents 7371e4a + 65dc4b5 commit d731627
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions SmartDeviceLink/private/SDLMenuManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,8 @@ - (SDLAddCommand *)sdl_commandForMenuCell:(SDLMenuCell *)cell withArtwork:(BOOL)
params.menuName = cell.title;
params.parentID = cell.parentCellId != UINT32_MAX ? @(cell.parentCellId) : nil;
params.position = @(position);
params.tertiaryText = cell.tertiaryText;
params.secondaryText = cell.secondaryText;
params.secondaryText = (cell.secondaryText.length == 0) ? nil : cell.secondaryText;
params.tertiaryText = (cell.tertiaryText.length == 0) ? nil : cell.tertiaryText;

command.menuParams = params;
command.vrCommands = (cell.voiceCommands.count == 0) ? nil : cell.voiceCommands;
Expand All @@ -695,7 +695,11 @@ - (SDLAddSubMenu *)sdl_subMenuCommandForMenuCell:(SDLMenuCell *)cell withArtwork
} else {
submenuLayout = self.menuConfiguration.defaultSubmenuLayout;
}
return [[SDLAddSubMenu alloc] initWithMenuID:cell.cellId menuName:cell.title position:@(position) menuIcon:icon menuLayout:submenuLayout parentID:nil secondaryText:cell.secondaryText tertiaryText:cell.tertiaryText secondaryImage:secondaryImage];

NSString *secondaryText = (cell.secondaryText.length == 0) ? nil : cell.secondaryText;
NSString *tertiaryText = (cell.tertiaryText.length == 0) ? nil : cell.tertiaryText;

return [[SDLAddSubMenu alloc] initWithMenuID:cell.cellId menuName:cell.title position:@(position) menuIcon:icon menuLayout:submenuLayout parentID:nil secondaryText:secondaryText tertiaryText:tertiaryText secondaryImage:secondaryImage];
}

#pragma mark - Calling handlers
Expand Down

0 comments on commit d731627

Please sign in to comment.