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:
parent
24b4db40f1
commit
9a3598ee00
1 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue