From 0cecd403cb36d1e8a70a0b37d306855dd97dda49 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Fri, 21 Jun 2013 17:07:45 -0700 Subject: [PATCH] Fixed an NPE. --- .../src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java index 6bb0baf6241..01284e76398 100644 --- a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java +++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java @@ -116,6 +116,8 @@ public final class CxxAstUtils { public static boolean isInMacro(IASTNode node) { IASTNodeSelector nodeSelector = node.getTranslationUnit().getNodeSelector(node.getTranslationUnit().getFilePath()); IASTFileLocation fileLocation = node.getFileLocation(); + if (fileLocation == null) + return true; IASTPreprocessorMacroExpansion macro = nodeSelector.findEnclosingMacroExpansion(fileLocation.getNodeOffset(), fileLocation.getNodeLength()); return macro != null;