src/Pure/PIDE/document.scala
changeset 68335 2f080a51a10d
parent 68323 bf7336731981
child 68365 f9379279f98c
--- a/src/Pure/PIDE/document.scala	Thu May 31 22:04:15 2018 +0200
+++ b/src/Pure/PIDE/document.scala	Thu May 31 22:10:06 2018 +0200
@@ -930,8 +930,10 @@
 
     def node_consolidated(version: Version, name: Node.Name): Boolean =
       !name.is_theory ||
-        version.nodes(name).commands.reverse.iterator.
-          flatMap(command_states(version, _)).exists(_.consolidated)
+      {
+        val it = version.nodes(name).commands.reverse.iterator
+        it.hasNext && command_states(version, it.next).exists(_.consolidated)
+      }
 
     // persistent user-view
     def snapshot(name: Node.Name = Node.Name.empty, pending_edits: List[Text.Edit] = Nil)