diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2018-10-18 10:59:58 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2018-10-18 10:59:58 -0400 |
commit | e279b7699ad775a5a6b48bc6bd0044ee9c5c92a2 (patch) | |
tree | 77bf55abd609feaa4b6c5f5e9657f0c45d2ec711 | |
parent | cc297ff3fc10fba1768c0156a0e7d141a4843fa7 (diff) | |
download | sdl_ios-e279b7699ad775a5a6b48bc6bd0044ee9c5c92a2.tar.gz |
Add checks to menu manager
-rw-r--r-- | SmartDeviceLink/SDLMenuManager.m | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLMenuManager.m b/SmartDeviceLink/SDLMenuManager.m index bbd61252b..aa8528a17 100644 --- a/SmartDeviceLink/SDLMenuManager.m +++ b/SmartDeviceLink/SDLMenuManager.m @@ -413,11 +413,25 @@ UInt32 const MenuCellIdMin = 1; - (void)sdl_registerResponse:(SDLRPCResponseNotification *)notification { SDLRegisterAppInterfaceResponse *response = (SDLRegisterAppInterfaceResponse *)notification.response; + + if (!response.success.boolValue) { return; } + if (response.displayCapabilities == nil) { + SDLLogE(@"RegisterAppInterface succeeded but didn't send a display capabilities. A lot of things will probably break."); + return; + } + self.displayCapabilities = response.displayCapabilities; } - (void)sdl_displayLayoutResponse:(SDLRPCResponseNotification *)notification { SDLSetDisplayLayoutResponse *response = (SDLSetDisplayLayoutResponse *)notification.response; + + if (!response.success.boolValue) { return; } + if (response.displayCapabilities == nil) { + SDLLogE(@"SetDisplayLayout succeeded but didn't send a display capabilities. A lot of things will probably break."); + return; + } + self.displayCapabilities = response.displayCapabilities; } |