diff options
author | Ken Ryall | 2009-08-07 15:39:31 +0000 |
---|---|---|
committer | Ken Ryall | 2009-08-07 15:39:31 +0000 |
commit | 998d50a356171cc151e8b1f74b78a24ee8cc2b8a (patch) | |
tree | a516a5cabde89eca3e505d0065342ef39818e8b8 /debug | |
parent | 766ecf9a49deedd89d2b7baad4c7f2fa26709165 (diff) | |
download | org.eclipse.cdt-998d50a356171cc151e8b1f74b78a24ee8cc2b8a.tar.gz org.eclipse.cdt-998d50a356171cc151e8b1f74b78a24ee8cc2b8a.tar.xz org.eclipse.cdt-998d50a356171cc151e8b1f74b78a24ee8cc2b8a.zip |
Fix NPE.
Diffstat (limited to 'debug')
-rw-r--r-- | debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/AbsolutePathSourceContainer.java | 20 |
1 files 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; |