IDEA-118777 NPE is thrown on attempt to close Debug Window that is deattached from...
authorVassiliy.Kudryashov <Vassiliy.Kudryashov@jetbrains.com>
Tue, 19 Aug 2014 12:04:31 +0000 (16:04 +0400)
committerVassiliy.Kudryashov <Vassiliy.Kudryashov@jetbrains.com>
Tue, 19 Aug 2014 12:05:51 +0000 (16:05 +0400)
platform/lang-impl/src/com/intellij/execution/ui/layout/impl/RunnerContentUi.java

index b8225b0c238b948d8111040aff9cd7798e0ea972..9df85468734a2da97c19b96a0acd7566cee64ef6 100644 (file)
@@ -518,13 +518,15 @@ public class RunnerContentUi implements ContentUI, Disposable, CellTransform.Fac
   @Override
   public void closeAll() {
     final Content[] contents = myManager.getContents();
-    for (Content content : contents) {
-      getStateFor(content).setWindow(0);
-    }
     if (myOriginal != null) {
       for (Content content : contents) {
+        getStateFor(content).setWindow(0);
         myOriginal.myManager.addContent(content);
-        myOriginal.findCellFor(content).minimize(content);
+        GridCell cell = myOriginal.findCellFor(content);
+        if (cell != null) {
+          myOriginal.restoreContent(content.getUserData(ViewImpl.ID));
+          cell.minimize(content);
+        }
       }
     }
     myManager.removeAllContents(false);