Merge pull request #851 from matiu/bug/undefined3

fix undefined bugs
This commit is contained in:
Gustavo Maximiliano Cortez 2014-07-07 20:44:59 -03:00
commit 6ea9831913
2 changed files with 4 additions and 1 deletions

View file

@ -226,6 +226,7 @@ Insight.prototype._requestNode = function(options, callback) {
};
Insight.prototype._requestBrowser = function(options, callback) {
var self = this;
var request = new XMLHttpRequest();
var url = (options.schema || 'http') + '://' + options.host;
@ -248,6 +249,7 @@ Insight.prototype._requestBrowser = function(options, callback) {
return callback(new Error('Insight request timeout'));
};
request.onreadystatechange = function() {
if (request.readyState !== 4) return;
var ret, errTxt, e;