From e8e4b344c0adfc20d080a0d2fce83840c99a21a7 Mon Sep 17 00:00:00 2001 From: John Camelon Date: Mon, 4 Jul 2005 15:55:20 +0000 Subject: [PATCH] Avoid NPE in LocationMap. --- .../eclipse/cdt/internal/core/parser/scanner2/LocationMap.java | 2 ++ 1 file changed, 2 insertions(+) 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) {