# HG changeset patch # User wenzelm # Date 1473854829 -7200 # Node ID 22037a819276f9f3ab22e716cffde614e7f723b2 # Parent fb46c031c8416e79136c756355c751afbc4c58ce more robust; diff -r fb46c031c841 -r 22037a819276 src/Tools/jEdit/src/isabelle.scala --- a/src/Tools/jEdit/src/isabelle.scala Wed Sep 14 12:56:57 2016 +0200 +++ b/src/Tools/jEdit/src/isabelle.scala Wed Sep 14 14:07:09 2016 +0200 @@ -61,11 +61,13 @@ } def buffer_syntax(buffer: JEditBuffer): Option[Outer_Syntax] = - (JEdit_Lib.buffer_mode(buffer), PIDE.document_model(buffer)) match { - case ("isabelle", Some(model)) => - Some(PIDE.session.recent_syntax(model.node_name)) - case (mode, _) => mode_syntax(mode) - } + if (buffer == null) None + else + (JEdit_Lib.buffer_mode(buffer), PIDE.document_model(buffer)) match { + case ("isabelle", Some(model)) => + Some(PIDE.session.recent_syntax(model.node_name)) + case (mode, _) => mode_syntax(mode) + } /* token markers */