Skip to content

Commit

Permalink
In the event a media type exists in an app today, and is removed from…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
danielpunkass committed Apr 11, 2018
1 parent 07a6962 commit 48c9686
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion IMBPanelController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
}

Expand Down

0 comments on commit 48c9686

Please sign in to comment.