Bug 9565, fix NPE.
--- 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;