mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix NPE
This commit is contained in:
parent
fc7419740e
commit
8a05fb1f3a
1 changed files with 5 additions and 1 deletions
|
@ -113,6 +113,7 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// TODO-model: handle non-absolute paths when finding source files
|
||||||
// ??? assert()
|
// ??? assert()
|
||||||
path = new Path("");
|
path = new Path("");
|
||||||
}
|
}
|
||||||
|
@ -121,7 +122,10 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa
|
||||||
ICProject cproject = getCProject();
|
ICProject cproject = getCProject();
|
||||||
SourceMapper mapper = mgr.getSourceMapper(cproject);
|
SourceMapper mapper = mgr.getSourceMapper(cproject);
|
||||||
if (mapper != null) {
|
if (mapper != null) {
|
||||||
tu = mapper.findTranslationUnit(path.lastSegment());
|
String lastSegment = path.lastSegment();
|
||||||
|
if (lastSegment != null) {
|
||||||
|
tu = mapper.findTranslationUnit(lastSegment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue