NPE on null folding builder
authorMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Fri, 19 Feb 2010 16:12:36 +0000 (19:12 +0300)
committerMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Fri, 19 Feb 2010 16:12:36 +0000 (19:12 +0300)
platform/lang-api/src/com/intellij/lang/folding/LanguageFolding.java

index e369efd4a07407f0b3caa47eccdc7a1f7273d370..232118cf37a4b7141e559a35766f6b518d046224 100644 (file)
@@ -73,7 +73,7 @@ public class LanguageFolding extends LanguageExtension<FoldingBuilder> {
       return ((FoldingBuilderEx)builder).buildFoldRegions(root, document, quick);
     }
     final ASTNode astNode = root.getNode();
-    if (astNode == null) {
+    if (astNode == null || builder == null) {
       return FoldingDescriptor.EMPTY;
     }