Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
Diffstat (limited to 'debug')
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/AbsolutePathSourceContainer.java14
1 files changed, 8 insertions, 6 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 edcdae1a3a6..a0ec7a6c375 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
@@ -49,12 +49,14 @@ public class AbsolutePathSourceContainer extends AbstractSourceContainer {
// The file is not already in the workspace so try to create an external translation unit for it.
String projectName = getDirector().getLaunchConfiguration().getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
- ICProject project = CoreModel.getDefault().getCModel().getCProject(projectName);
- if (project != null)
- {
- IPath path = Path.fromOSString(file.getCanonicalPath());
- String id = CoreModel.getRegistedContentTypeId(project.getProject(), path.lastSegment());
- return new ExternalTranslationUnit[] { new ExternalTranslationUnit(project, new Path(file.getCanonicalPath()), id) };
+ if (projectName != "") {
+ ICProject project = CoreModel.getDefault().getCModel().getCProject(projectName);
+ if (project != null)
+ {
+ IPath path = Path.fromOSString(file.getCanonicalPath());
+ String id = CoreModel.getRegistedContentTypeId(project.getProject(), path.lastSegment());
+ return new ExternalTranslationUnit[] { new ExternalTranslationUnit(project, new Path(file.getCanonicalPath()), id) };
+ }
}
} catch (IOException e) { // ignore if getCanonicalPath throws
} catch (CoreException e) {

Back to the top