Prevent attribute error on timeout

This commit is contained in:
JC Brand 2021-07-19 16:02:28 +02:00
parent d1abf3a04e
commit 8931c61876

View File

@ -1540,7 +1540,8 @@ const ChatRoomMixin = {
if (u.isErrorObject(result)) { if (u.isErrorObject(result)) {
throw result; throw result;
} }
const identity_el = result.querySelector('query[node="x-roomuser-item"] identity'); // Result might be undefined due to a timeout
const identity_el = result?.querySelector('query[node="x-roomuser-item"] identity');
return identity_el ? identity_el.getAttribute('name') : null; return identity_el ? identity_el.getAttribute('name') : null;
}, },