# HG changeset patch # User ryall # Date 1249659457 18000 # Node ID b9108837a1fca4657c5cbe062fd35543f4951984 # Parent c430da7700d9c98cb4237b6da245e7d46b136f57 Bug 9565, fix NPE. diff -r c430da7700d9 -r b9108837a1fc cdt/cdt_6_0_x/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/AbsolutePathSourceContainer.java --- a/cdt/cdt_6_0_x/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/AbsolutePathSourceContainer.java Fri Aug 07 08:05:16 2009 -0500 +++ b/cdt/cdt_6_0_x/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/AbsolutePathSourceContainer.java Fri Aug 07 10:37:37 2009 -0500 @@ -88,14 +88,18 @@ * @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;