diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconciler.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconciler.java index 6a6224badcd..b70432670c3 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconciler.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconciler.java @@ -161,9 +161,11 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener { if (useLocation != null) { IASTPreprocessorMacroDefinition macroDef= ((IASTMacroExpansion)nodeLocations[0]).getMacroDefinition(); IASTNodeLocation defLocation= macroDef.getName().getFileLocation(); - IASTNode macroNode= node.getTranslationUnit().selectNodeForLocation(fFilePath, useLocation.getNodeOffset(), defLocation.getNodeLength()); - if (macroNode != null && visitMacro(macroNode, defLocation.getNodeLength())) { - return true; + if (defLocation != null) { + IASTNode macroNode= node.getTranslationUnit().selectNodeForLocation(fFilePath, useLocation.getNodeOffset(), defLocation.getNodeLength()); + if (macroNode != null && visitMacro(macroNode, defLocation.getNodeLength())) { + return true; + } } } }