IDEA-129496 "java.lang.IllegalArgumentException: Argument for @NotNull parameter...
authorMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Wed, 10 Sep 2014 12:58:56 +0000 (14:58 +0200)
committerMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Wed, 10 Sep 2014 13:02:25 +0000 (15:02 +0200)
platform/core-api/src/com/intellij/lang/folding/CustomFoldingBuilder.java

index f43c1c9b55ae6e4fe224e56f6ca24cdc97f8a122..ab03627d7d6a03b7573d88c8dc27635e665d5993 100644 (file)
@@ -45,7 +45,9 @@ public abstract class CustomFoldingBuilder extends FoldingBuilderEx implements P
     if (CustomFoldingProvider.getAllProviders().length > 0) {
       myDefaultProvider = null;
       ASTNode rootNode = root.getNode();
-      addCustomFoldingRegionsRecursively(new FoldingStack(rootNode), rootNode, descriptors, 0);
+      if (rootNode != null) {
+        addCustomFoldingRegionsRecursively(new FoldingStack(rootNode), rootNode, descriptors, 0);
+      }
     }
     buildLanguageFoldRegions(descriptors, root, document, quick);
     return descriptors.toArray(new FoldingDescriptor[descriptors.size()]);