Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2016-07-18 18:23:55 +0000
committerEugene Tarassov2016-07-18 18:23:55 +0000
commit4a3f8d6ce5ed3ad288a4849e2966e8d2237cd194 (patch)
tree6bf6035423facb4d378d9c4e382fc3e24a22e8f2 /plugins
parentced0e5123359da2737f3e783c7d9be4904101a5a (diff)
downloadorg.eclipse.tcf-4a3f8d6ce5ed3ad288a4849e2966e8d2237cd194.tar.gz
org.eclipse.tcf-4a3f8d6ce5ed3ad288a4849e2966e8d2237cd194.tar.xz
org.eclipse.tcf-4a3f8d6ce5ed3ad288a4849e2966e8d2237cd194.zip
TCF Debugger: fixed NullPointerException in BreakpointPreferencePage.checkTCFToggleBreakpointAdapter
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/preferences/BreakpointPreferencePage.java28
1 files changed, 16 insertions, 12 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/preferences/BreakpointPreferencePage.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/preferences/BreakpointPreferencePage.java
index 3810a4003..8cab3e3cb 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/preferences/BreakpointPreferencePage.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/preferences/BreakpointPreferencePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 Wind River Systems, Inc. and others.
+ * Copyright (c) 2011, 2016 Wind River Systems, Inc. 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
@@ -15,6 +15,7 @@ import java.util.Set;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.preference.*;
import org.eclipse.ui.IWorkbenchPart;
@@ -167,18 +168,21 @@ public class BreakpointPreferencePage extends FieldEditorPreferencePage implemen
part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
}
if (part != null) {
- ISelection selection = part.getSite().getSelectionProvider().getSelection();
- Set<?> enablers = DebugUITools.getToggleBreakpointsTargetManager().getEnabledToggleBreakpointsTargetIDs(part, selection);
-
- if (enablers != null &&
- !enablers.contains(TCFToggleBreakpointsTargetFactory.ID_TCF_BREAKPOINT_TOGGLE_TARGET)) {
- return true;
- }
+ ISelectionProvider provider = part.getSite().getSelectionProvider();
+ if (provider != null) {
+ ISelection selection = provider.getSelection();
+ Set<?> enablers = DebugUITools.getToggleBreakpointsTargetManager().getEnabledToggleBreakpointsTargetIDs(part, selection);
+
+ if (enablers != null &&
+ !enablers.contains(TCFToggleBreakpointsTargetFactory.ID_TCF_BREAKPOINT_TOGGLE_TARGET)) {
+ return true;
+ }
- String preferred = DebugUITools.getToggleBreakpointsTargetManager().getPreferredToggleBreakpointsTargetID(part, selection);
- if (preferred != null &&
- !preferred.equals(TCFToggleBreakpointsTargetFactory.ID_TCF_BREAKPOINT_TOGGLE_TARGET)) {
- return false;
+ String preferred = DebugUITools.getToggleBreakpointsTargetManager().getPreferredToggleBreakpointsTargetID(part, selection);
+ if (preferred != null &&
+ !preferred.equals(TCFToggleBreakpointsTargetFactory.ID_TCF_BREAKPOINT_TOGGLE_TARGET)) {
+ return false;
+ }
}
}
return true;

Back to the top