Make sure that the xhr object still exists after the abort is called.
[jquery.git] / src / ajax.js
index 83e5bdc..8aa6a9a 100644 (file)
@@ -455,10 +455,11 @@ jQuery.extend({
                try {
                        var oldAbort = xhr.abort;
                        xhr.abort = function() {
-                               oldAbort.call( xhr );
-
                                if ( xhr ) {
-                                       xhr.readyState = 0;
+                                       oldAbort.call( xhr );
+                                       if ( xhr ) {
+                                               xhr.readyState = 0;
+                                       }
                                }
 
                                onreadystatechange();