web/data/cubicweb.ajax.js
changeset 10412 3540131a8405
parent 10411 4ee15441f2eb
child 10434 8e04ab5582d9
--- a/web/data/cubicweb.ajax.js	Mon Jun 22 14:27:37 2015 +0200
+++ b/web/data/cubicweb.ajax.js	Wed May 13 15:58:21 2015 +0200
@@ -39,7 +39,7 @@
     },
 
     addCallback: function(callback) {
-        if ((this._req.readyState == 4) && this._result) {
+        if (this._req && (this._req.readyState == 4) && this._result) {
             var args = [this._result, this._req];
             jQuery.merge(args, cw.utils.sliceList(arguments, 1));
             callback.apply(null, args);
@@ -51,7 +51,7 @@
     },
 
     addErrback: function(callback) {
-        if (this._req.readyState == 4 && this._error) {
+        if (this._req && this._req.readyState == 4 && this._error) {
             callback.apply(null, [this._error, this._req]);
         }
         else {