From 3f1a711c1570cf366b162e3595ed87f84d4e2668 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 12 Jun 2008 12:19:30 -0400 Subject: [PATCH] Protect against array out of bounds exceptions when removing breakpoints * Source/BreakpointWindowController.m: (removeBreakpoint:): If there are no selected objects in the NS-AC, don't try to remove breakpoints --- Source/BreakpointWindowController.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/BreakpointWindowController.m b/Source/BreakpointWindowController.m index ed088f2..08062df 100644 --- a/Source/BreakpointWindowController.m +++ b/Source/BreakpointWindowController.m @@ -55,7 +55,13 @@ */ - (IBAction)removeBreakpoint:(id)sender { - Breakpoint *bp = [[arrayController selectedObjects] objectAtIndex:0]; + NSArray *selection = [arrayController selectedObjects]; + if ([selection count] < 1) + { + return; + } + + Breakpoint *bp = [selection objectAtIndex:0]; [manager removeBreakpointAt:[bp line] inFile:[bp file]]; } -- 2.43.5