aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-06-12 15:17:44 +0000
committerBibiko <bibiko@eva.mpg.de>2010-06-12 15:17:44 +0000
commit03bdabf809d02a7f76c2fbc02841bb1030c49a47 (patch)
treede94ee5c16f0b746d5528492019fe655133f2b0e
parent16fc04e9bae49425540d623933946ec4dc933d6f (diff)
downloadsequelpro-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
-rw-r--r--Source/SPWindowController.m7
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) {