EA-64416 - NPE: DumpLookupElementWeights.getLookupElementWeights
authorpeter <peter@jetbrains.com>
Mon, 9 Feb 2015 14:21:25 +0000 (15:21 +0100)
committerpeter <peter@jetbrains.com>
Mon, 9 Feb 2015 15:26:05 +0000 (16:26 +0100)
platform/lang-impl/src/com/intellij/internal/DumpLookupElementWeights.java

index 6350642c772eacf722f84157a734586589df8aae..8ae1cc85f72f654752acc0a98febb60ae3a5e797 100644 (file)
@@ -66,7 +66,8 @@ public class DumpLookupElementWeights extends AnAction implements DumbAware {
     final Map<LookupElement,StringBuilder> strings = lookup.getRelevanceStrings();
     List<String> sb = new ArrayList<String>();
     for (LookupElement item : lookup.getItems()) {
-      String weight = strings.get(item).toString();
+      StringBuilder builder = strings.get(item);
+      String weight = builder == null ? "null" : builder.toString();
       final String s = item.getLookupString() + "\t" + weight;
       sb.add(s);
     }