From 8ae4492a1dfdeac0f71c613ce3288dcd7905aff7 Mon Sep 17 00:00:00 2001 From: Daniel Jalkut Date: Wed, 21 Mar 2018 17:39:54 -0400 Subject: [PATCH] In the event a media type exists in an app today, and is removed from the app in the future, an exception will be thrown trying to restore the user's last selected tab. This fix simply tests first to see if the specified identifier is represented in the tab view, and if it is not, defaults to the first tab. --- IMBPanelController.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/IMBPanelController.m b/IMBPanelController.m index c5fbc73c4..5ffb06b17 100644 --- a/IMBPanelController.m +++ b/IMBPanelController.m @@ -443,10 +443,14 @@ - (void) restoreStateFromPreferences [self tabView:ibTabView willSelectTabViewItem:tabViewItem]; [self tabView:ibTabView didSelectTabViewItem:tabViewItem]; } - else + else if ([ibTabView indexOfTabViewItemWithIdentifier:mediaType] != NSNotFound) { [ibTabView selectTabViewItemWithIdentifier:mediaType]; } + else + { + [ibTabView selectFirstTabViewItem:nil]; + } } }