We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bd450b commit 76ce16cCopy full SHA for 76ce16c
lib/codemirror.js
@@ -1439,14 +1439,14 @@ var CodeMirror = (function() {
1439
spec = mimeModes[spec];
1440
if (typeof spec == "string")
1441
var mname = spec, config = {};
1442
- else
+ else if (spec != null)
1443
var mname = spec.name, config = spec;
1444
var mfactory = modes[mname];
1445
if (!mfactory) {
1446
if (window.console) console.warn("No mode " + mname + " found, falling back to plain text.");
1447
return CodeMirror.getMode(options, "text/plain");
1448
}
1449
- return mfactory(options, config);
+ return mfactory(options, config || {});
1450
1451
CodeMirror.listModes = function() {
1452
var list = [];
0 commit comments