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:
parent
8fe932e6c3
commit
94a68d1f4e
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue