diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTNode.java index 5b06431a85c..9db66eea57e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTNode.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTNode.java @@ -98,7 +98,9 @@ public abstract class ASTNode implements IASTNode { public IASTFileLocation getFileLocation() { if( fileLocation != null ) return fileLocation; - fileLocation = getTranslationUnit().flattenLocationsToFile( getNodeLocations() ); + IASTTranslationUnit ast = getTranslationUnit(); + if (ast != null) + fileLocation = ast.flattenLocationsToFile( getNodeLocations() ); return fileLocation; }