Bug 9565, fix NPE.
authorryall
Fri, 07 Aug 2009 10:37:37 -0500
changeset 57 b9108837a1fc
parent 56 c430da7700d9
child 58 cc2106dba4d1
Bug 9565, fix NPE.
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;