From b1ce1b2244a78440d9ece150752c8579d8d56c36 Mon Sep 17 00:00:00 2001 From: Ken Ryall Date: Fri, 7 Aug 2009 15:40:51 +0000 Subject: [PATCH] Fix NPE. --- .../AbsolutePathSourceContainer.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/AbsolutePathSourceContainer.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/AbsolutePathSourceContainer.java index b0a562033fd..c624af176f3 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/AbsolutePathSourceContainer.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/AbsolutePathSourceContainer.java @@ -88,14 +88,18 @@ public class AbsolutePathSourceContainer extends AbstractSourceContainer { * @return IProject or null */ private IProject getProject() { - ILaunchConfiguration config = getDirector().getLaunchConfiguration(); - if (config != null) { - try { - String name = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); - if (name.length() > 0) - return ResourcesPlugin.getWorkspace().getRoot().getProject(name); - } catch (CoreException e) { - // Don't care carry on search using other heuristics + ISourceLookupDirector director = getDirector(); + if (director != null) + { + ILaunchConfiguration config = director.getLaunchConfiguration(); + if (config != null) { + try { + String name = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$ + if (name.length() > 0) + return ResourcesPlugin.getWorkspace().getRoot().getProject(name); + } catch (CoreException e) { + // Don't care carry on search using other heuristics + } } } return null;