- if ( (source == ITMTRemoteSharedLibrarySource) || (source == ITMTRemoteiPodSource) || (source == ITMTRemoteGenericDeviceSource) || (source == ITMTRemoteCDSource) ) {
- tempItem = [playlistsMenu itemAtIndex:[playlistsMenu numberOfItems] + [indices indexOfObject:[NSNumber numberWithInt:[[[MainController sharedController] currentRemote] currentSourceIndex]]] - [indices count]];
- [tempItem setState:NSOnState];
- [[[tempItem submenu] itemAtIndex:_currentPlaylist - 1] setState:NSOnState];
- } else if (source == ITMTRemoteLibrarySource && _currentPlaylist) {
- [[playlistsMenu itemAtIndex:_currentPlaylist - 1] setState:NSOnState];
- }
+ NS_DURING
+ if (_currentPlaylist != -1) {
+ if ( (source == ITMTRemoteSharedLibrarySource) || (source == ITMTRemoteiPodSource) || (source == ITMTRemoteGenericDeviceSource) || (source == ITMTRemoteCDSource) ) {
+ tempItem = [playlistsMenu itemAtIndex:[playlistsMenu numberOfItems] + [indices indexOfObject:[NSNumber numberWithInt:[[[MainController sharedController] currentRemote] currentSourceIndex]]] - [indices count]];
+ [tempItem setState:NSOnState];
+ [[[tempItem submenu] itemAtIndex:_currentPlaylist - 1] setState:NSOnState];
+ } else if (source == ITMTRemoteLibrarySource && _currentPlaylist) {
+ [[playlistsMenu itemAtIndex:_currentPlaylist - 1] setState:NSOnState];
+ }
+ }
+ NS_HANDLER
+ NS_ENDHANDLER