Skip to content

A platform for community discussion. Free, open, simple.

FIX: Avoid error on ajax.abort() when client has not opened the request.

Guo Xiang Tana6d93f631733
diff --git a/app/assets/javascripts/discourse/lib/ajax.js.es6 b/app/assets/javascripts/discourse/lib/ajax.js.es6
index dc81ce6cd1a..34207773e29 100644
--- a/app/assets/javascripts/discourse/lib/ajax.js.es6
+++ b/app/assets/javascripts/discourse/lib/ajax.js.es6
@@ -105,6 +105,8 @@ export function ajax() {
};
args.error = (xhr, textStatus, errorThrown) => {
+ // 0 represents the `UNSENT` state
+ if (xhr.readyState === 0) return;
handleLogoff(xhr);
// note: for bad CSRF we don't loop an extra request right away.