NPE
authorAlexey Kudravtsev <cdr@intellij.com>
Fri, 13 Aug 2010 10:36:04 +0000 (14:36 +0400)
committerAlexey Kudravtsev <cdr@intellij.com>
Fri, 13 Aug 2010 15:27:02 +0000 (19:27 +0400)
platform/lang-impl/src/com/intellij/codeInsight/folding/impl/DocumentFoldingInfo.java

index 406821455418e238c8c4c9ebfd6eadd6d8faf5fb..ca7ee42c685bade094ae050a96f5442e586ae110 100644 (file)
@@ -128,7 +128,7 @@ public class DocumentFoldingInfo implements JDOMExternalizable, CodeFoldingState
           String placeHolderText = myPlaceholderTexts.get(marker);
           region = ((FoldingModelEx)editor.getFoldingModel()).createFoldRegion(marker.getStartOffset(), marker.getEndOffset(), placeHolderText, null);  
           //may fail to add in case intersecting region exists
-          if (!editor.getFoldingModel().addFoldRegion(region)) return;
+          if (region == null || !editor.getFoldingModel().addFoldRegion(region)) return;
         }
 
         boolean state = myExpandedStates.get(i).booleanValue();