From f9481eeb19dce16094599129175412d103f1ccd4 Mon Sep 17 00:00:00 2001 From: David Chen Date: Tue, 11 Sep 2012 10:28:01 +0800 Subject: [PATCH] Fix Cannot read property env of null --- lib/ace/ace.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ace/ace.js b/lib/ace/ace.js index c6f087ff..3dd08504 100644 --- a/lib/ace/ace.js +++ b/lib/ace/ace.js @@ -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)