From 558fca8f5efb66a10af59a377494c6f6adc04716 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 17 Apr 2007 13:54:35 +0000 Subject: [PATCH] Make the open decl on includes a little safer. --- .../internal/ui/search/actions/OpenDeclarationsAction.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsAction.java index 8808d0e112a..40207721f9e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsAction.java @@ -126,13 +126,16 @@ public class OpenDeclarationsAction extends SelectionParseAction { for (int i = 0; i < preprocs.length; ++i) { if (!(preprocs[i] instanceof IASTPreprocessorIncludeStatement)) continue; + IASTPreprocessorIncludeStatement incStmt = (IASTPreprocessorIncludeStatement)preprocs[i]; + if (!incStmt.isResolved()) + continue; IASTFileLocation loc = preprocs[i].getFileLocation(); if (loc != null && loc.getFileName().equals(ast.getFilePath()) && loc.getNodeOffset() < selectionStart && loc.getNodeOffset() + loc.getNodeLength() > selectionStart) { // Got it - String name = ((IASTPreprocessorIncludeStatement)preprocs[i]).getPath(); + String name = incStmt.getPath(); if (name != null) { final IPath path = new Path(name); runInUIThread(new Runnable() {