only set codemirror mode if it exists

This commit is contained in:
Min RK 2017-04-19 15:18:14 +02:00
parent a2f6a8c3bb
commit 97f4913c16

View File

@ -61,7 +61,9 @@ function(
var modename = cfg.file_extension_modes[that._get_file_extension()];
if (modename) {
var modeinfo = CodeMirror.findModeByName(modename);
that.set_codemirror_mode(modeinfo);
if (modeinfo) {
that.set_codemirror_mode(modeinfo);
}
}
}
that._clean_state();