From 03bdabf809d02a7f76c2fbc02841bb1030c49a47 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Sat, 12 Jun 2010 15:17:44 +0000 Subject: =?UTF-8?q?=E2=80=A2=20avoid=20exception=20for=20showing=20tooltip?= =?UTF-8?q?=20if=20tab=20will=20be=20closed=20by=20checking=20tab=20index?= =?UTF-8?q?=20against=20number=20of=20tabs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPWindowController.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Source') 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) { -- cgit v1.2.3