--- 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 */