diff options
author | Mike Rennie | 2013-02-06 15:30:57 +0000 |
---|---|---|
committer | Mike Rennie | 2013-02-06 15:31:17 +0000 |
commit | 55d1d2ab44772d19493935e5fa53e12335450f24 (patch) | |
tree | e1959ba453979d5da9cd178e18499e1e8f4655ba /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints | |
parent | 3fafb34ed7db2b460fd3eeaf7da35b2590afb0d3 (diff) | |
download | eclipse.platform.debug-55d1d2ab44772d19493935e5fa53e12335450f24.tar.gz eclipse.platform.debug-55d1d2ab44772d19493935e5fa53e12335450f24.tar.xz eclipse.platform.debug-55d1d2ab44772d19493935e5fa53e12335450f24.zip |
Bug 399514 - NPE in BreakpointContainerLabelProvider
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints')
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java index 59b22baad..bcb706129 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -153,19 +153,18 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap * @return the index of the breakpoint in the cache, -1 if the breakpoint already exist */ private int insertBreakpoint(IBreakpoint breakpoint) { - if (fBreakpoints.contains(breakpoint)) + if (fBreakpoints.contains(breakpoint) || breakpoint == null) { return -1; - + } int index = fBreakpoints.size(); for (; fComparator != null && index > 0; index--) { if (fComparator.compare(fBreakpoints.get(index-1), breakpoint) < 0) break; } - - if (index < 0) + if (index < 0) { index = 0; + } fBreakpoints.add(index, breakpoint); - return index; } |