From 93b7f29f9d40a617d734c034d78402942b1af5f7 Mon Sep 17 00:00:00 2001 From: Alvaro Sanchez-Leon Date: Fri, 31 Jul 2015 14:24:23 -0400 Subject: [PATCH] Bug 474054 - Null Pointer Exception in "Properties for C/C++ Watchpoint" when deselecting the "Range" check box Change-Id: I3ba0cac2bd3e8f9e52378d9d5cc0c25981369a6a --- .../ui/breakpoints/CBreakpointPropertyPage.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPropertyPage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPropertyPage.java index 95b39bc5088..80ef12f64a4 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPropertyPage.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPropertyPage.java @@ -840,7 +840,9 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement ICBreakpoint currentBp = getBreakpoint(); if (!(currentBp instanceof ICFunctionBreakpoint) && - !(currentBp instanceof ICAddressBreakpoint)) { + !(currentBp instanceof ICAddressBreakpoint) && + !(currentBp instanceof ICWatchpoint) && + !(currentBp instanceof ICEventBreakpoint)) { // Check for duplication of line breakpoints if (event.getProperty().equals(FieldEditor.VALUE)) { if (super.isValid()) { @@ -877,7 +879,12 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement source = getPreferenceStore().getString(ICBreakpoint.SOURCE_HANDLE); } - int line = fLineEditor.getIntValue(); + // We only check duplicates for Breakpoints with lines numbers + if (fLineEditor == null) { + return false; + } + + int line = fLineEditor.getIntValue(); // Look for any breakpoint that has the same source file and line number as what // is currently being inputed. Careful not to compare with the current breakpoint