1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

Make the open decl on includes a little safer.

This commit is contained in:
Doug Schaefer 2007-04-17 13:23:50 +00:00
parent 8fe932e6c3
commit 94a68d1f4e

View file

@ -127,7 +127,8 @@ public class OpenDeclarationsAction extends SelectionParseAction {
if (!(preprocs[i] instanceof IASTPreprocessorIncludeStatement))
continue;
IASTFileLocation loc = preprocs[i].getFileLocation();
if (loc.getFileName().equals(ast.getFilePath())
if (loc != null
&& loc.getFileName().equals(ast.getFilePath())
&& loc.getNodeOffset() < selectionStart
&& loc.getNodeOffset() + loc.getNodeLength() > selectionStart) {
// Got it