diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-06-12 15:17:44 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-06-12 15:17:44 +0000 |
commit | 03bdabf809d02a7f76c2fbc02841bb1030c49a47 (patch) | |
tree | de94ee5c16f0b746d5528492019fe655133f2b0e /Source/SPWindowController.m | |
parent | 16fc04e9bae49425540d623933946ec4dc933d6f (diff) | |
download | sequelpro-03bdabf809d02a7f76c2fbc02841bb1030c49a47.tar.gz sequelpro-03bdabf809d02a7f76c2fbc02841bb1030c49a47.tar.bz2 sequelpro-03bdabf809d02a7f76c2fbc02841bb1030c49a47.zip |
• avoid exception for showing tooltip if tab will be closed by checking tab index against number of tabs
Diffstat (limited to 'Source/SPWindowController.m')
-rw-r--r-- | Source/SPWindowController.m | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/SPWindowController.m b/Source/SPWindowController.m index 23b1bc9b..47f4d7fa 100644 --- a/Source/SPWindowController.m +++ b/Source/SPWindowController.m @@ -281,7 +281,12 @@ */ - (NSString *)tabView:(NSTabView *)aTabView toolTipForTabViewItem:(NSTabViewItem *)tabViewItem { - PSMTabBarCell *theCell = [[tabBar cells] objectAtIndex:[tabView indexOfTabViewItem:tabViewItem]]; + + NSInteger tabIndex = [tabView indexOfTabViewItem:tabViewItem]; + + if([[tabBar cells] count] < tabIndex) return @""; + + PSMTabBarCell *theCell = [[tabBar cells] objectAtIndex:tabIndex]; // If cell is selected show tooltip if truncated only if([theCell tabState] & PSMTab_SelectedMask) { |