more robust after shutdown;
authorwenzelm
Tue, 01 Oct 2019 11:42:23 +0200
changeset 70776 93aed7526a94
parent 70775 97d3485028b6
child 70777 b52a12559d92
more robust after shutdown;
src/Pure/PIDE/session.scala
--- a/src/Pure/PIDE/session.scala	Tue Oct 01 11:29:03 2019 +0200
+++ b/src/Pure/PIDE/session.scala	Tue Oct 01 11:42:23 2019 +0200
@@ -671,9 +671,12 @@
 
   def get_state(): Document.State =
   {
-    val promise = Future.promise[Document.State]
-    manager.send_wait(Get_State(promise))
-    promise.join
+    if (manager.is_active) {
+      val promise = Future.promise[Document.State]
+      manager.send_wait(Get_State(promise))
+      promise.join
+    }
+    else Document.State.init
   }
 
   def snapshot(name: Document.Node.Name = Document.Node.Name.empty,