Fix Cannot read property env of null

This commit is contained in:
David Chen 2012-09-11 10:28:01 +08:00
commit f9481eeb19

View file

@ -65,7 +65,10 @@ exports.config = require("./config");
**/
exports.edit = function(el) {
if (typeof(el) == "string") {
el = document.getElementById(el);
var _id = el;
if (!(el = document.getElementById(el))) {
console.log("can't match div #" + _id);
}
}
if (el.env && el.env.editor instanceof Editor)