Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
wants to merge 1 commit into from

2 participants

Alex Davies Harutyun Amirjanyan
Alex Davies

Previous "Cannot read property env of null" commit only logged an a message to console and didn't prevent script continuing (and therefore failing)

Harutyun Amirjanyan nightwing commented on the diff
lib/ace/ace.js
@@ -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;
Harutyun Amirjanyan Owner

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Harutyun Amirjanyan
Owner

replaced console.log with throw.
thanks.

Harutyun Amirjanyan nightwing closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 12, 2012
  1. Alex Davies
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/ace/ace.js
2  lib/ace/ace.js
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;
Harutyun Amirjanyan Owner

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
}
}
Something went wrong with that request. Please try again.