mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fixed NPE caused by rev 1.31 in following scenario: you open a C file with File > Open that is not in the workspace, then create a breakpoint (double-click). Selecting the breakpoint in the Breakpoints view would result in an NPE.
This commit is contained in:
parent
f664db7f71
commit
dbcc86e5c5
1 changed files with 9 additions and 4 deletions
|
@ -177,10 +177,15 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode
|
|||
// open the file from the breakpoints view it opens in the
|
||||
// proper editor.
|
||||
IProject project = b.getMarker().getResource().getProject();
|
||||
ICProject cproject = CoreModel.getDefault().create(project);
|
||||
String id = CoreModel.getRegistedContentTypeId(project, path.lastSegment());
|
||||
ExternalTranslationUnit tu = new ExternalTranslationUnit(cproject, URIUtil.toURI(path), id);
|
||||
return new ExternalEditorInput( tu );
|
||||
if (project != null) {
|
||||
ICProject cproject = CoreModel.getDefault().create(project);
|
||||
String id = CoreModel.getRegistedContentTypeId(project, path.lastSegment());
|
||||
ExternalTranslationUnit tu = new ExternalTranslationUnit(cproject, URIUtil.toURI(path), id);
|
||||
return new ExternalEditorInput( tu );
|
||||
}
|
||||
else {
|
||||
return new ExternalEditorInput(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue