From 65adceff69e5b3e1d9fb4bf50f18e011b8d04ba7 Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Mon, 17 Mar 2008 09:57:04 +0000 Subject: [PATCH] Fix NPE --- .../ManageFunctionBreakpointActionDelegate.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageFunctionBreakpointActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageFunctionBreakpointActionDelegate.java index a114d04a09e..fc6c868edb9 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageFunctionBreakpointActionDelegate.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageFunctionBreakpointActionDelegate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2007 QNX Software Systems and others. + * Copyright (c) 2004, 2008 QNX Software Systems 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 @@ -88,9 +88,11 @@ public class ManageFunctionBreakpointActionDelegate extends ActionDelegate imple IContributedContentsView contentsView = (IContributedContentsView) fTargetPart.getAdapter(IContributedContentsView.class); if (contentsView != null) { IWorkbenchPart contributingPart = contentsView.getContributingPart(); - resource = (IResource) contributingPart.getAdapter(IResource.class); - if (resource == null && contributingPart instanceof IEditorPart) { - resource = (IResource) ((IEditorPart)contributingPart).getEditorInput().getAdapter(IResource.class); + if (contributingPart != null) { + resource = (IResource) contributingPart.getAdapter(IResource.class); + if (resource == null && contributingPart instanceof IEditorPart) { + resource = (IResource) ((IEditorPart)contributingPart).getEditorInput().getAdapter(IResource.class); + } } } }