FIX: Prevent errors in IE11 following AJAX request

In some situations, the xhr object is undefined, so check that it's present before continuing
This commit is contained in:
David Taylor 2019-12-18 13:38:36 +00:00
parent b4f28ce2b1
commit 96bfefac5c
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ export function viewTrackingRequired() {
}
export function handleLogoff(xhr) {
if (xhr.getResponseHeader("Discourse-Logged-Out") && !_showingLogout) {
if (xhr && xhr.getResponseHeader("Discourse-Logged-Out") && !_showingLogout) {
_showingLogout = true;
const messageBus = Discourse.__container__.lookup("message-bus:main");
messageBus.stop();