FIX: IE11 compatibility for readonly check

In some situations, the xhr object is undefined in IE11
This commit is contained in:
David Taylor 2019-12-18 16:57:20 +00:00
parent 37c9579a01
commit fab3bbf705
1 changed files with 1 additions and 1 deletions

View File

@ -103,7 +103,7 @@ export function ajax() {
run(() => {
Site.currentProp(
"isReadOnly",
!!xhr.getResponseHeader("Discourse-Readonly")
!!(xhr && xhr.getResponseHeader("Discourse-Readonly"))
);
});