Actually fix "Cannot read property env of null" #1029

Closed
wants to merge 1 commit into
from
Jump to file
+1 −1
Split
View
@@ -67,7 +67,7 @@ exports.edit = function(el) {
if (typeof(el) == "string") {
var _id = el;
if (!(el = document.getElementById(el))) {
- console.log("can't match div #" + _id);
+ return false;
nightwing
nightwing Oct 13, 2012 Member

why is it good for ace.edit to silently fail here?
shouldn't this be throw "ace.edit can't find div #" + _id; instead?

disjunto
disjunto Oct 14, 2012

That would probably be a better solution.

was returning false as an easy to check failure of initialisation, logging to console did absolutely nothing to fix the crash of a missing element

}
}