diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/LocationMap.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/LocationMap.java index 8194ba80f26..b7d068d9dde 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/LocationMap.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/LocationMap.java @@ -1619,6 +1619,8 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog { if (tu == null) return EMPTY_LOCATION_ARRAY; _Context c = findContextForOffset(offset); + if( c == null ) + return EMPTY_LOCATION_ARRAY; int offset1 = offset + length; if ((offset1 >= c.context_directive_start && offset1 <= c.context_ends)) { if (c instanceof _CompositeContext) {