فهرست منبع

Prevent attribute error on timeout

JC Brand 4 سال پیش
والد
کامیت
8931c61876
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      src/headless/plugins/muc/muc.js

+ 2 - 1
src/headless/plugins/muc/muc.js

@@ -1540,7 +1540,8 @@ const ChatRoomMixin = {
         if (u.isErrorObject(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;
     },