1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

Avoid possible NPE

This commit is contained in:
Anton Leherbauer 2007-03-16 14:58:57 +00:00
parent 24b4db40f1
commit 9a3598ee00

View file

@ -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;
}
}
}
}