mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Fix NPE.
This commit is contained in:
parent
daff450887
commit
b1ce1b2244
1 changed files with 12 additions and 8 deletions
|
@ -88,14 +88,18 @@ public class AbsolutePathSourceContainer extends AbstractSourceContainer {
|
||||||
* @return IProject or null
|
* @return IProject or null
|
||||||
*/
|
*/
|
||||||
private IProject getProject() {
|
private IProject getProject() {
|
||||||
ILaunchConfiguration config = getDirector().getLaunchConfiguration();
|
ISourceLookupDirector director = getDirector();
|
||||||
if (config != null) {
|
if (director != null)
|
||||||
try {
|
{
|
||||||
String name = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
|
ILaunchConfiguration config = director.getLaunchConfiguration();
|
||||||
if (name.length() > 0)
|
if (config != null) {
|
||||||
return ResourcesPlugin.getWorkspace().getRoot().getProject(name);
|
try {
|
||||||
} catch (CoreException e) {
|
String name = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
|
||||||
// Don't care carry on search using other heuristics
|
if (name.length() > 0)
|
||||||
|
return ResourcesPlugin.getWorkspace().getRoot().getProject(name);
|
||||||
|
} catch (CoreException e) {
|
||||||
|
// Don't care carry on search using other heuristics
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue