소스 검색

fix: ensure mucNickname

dev1
Giovanni Cascio 3 년 전
부모
커밋
4ead244ec5
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2
    2
      JitsiConference.js

+ 2
- 2
JitsiConference.js 파일 보기

@@ -326,14 +326,14 @@ JitsiConference.resourceCreator = function(jid, isAuthenticatedUser) {
326 326
         // We try to use the first part of the node (which for anonymous users
327 327
         // on prosody is a UUID) to match the previous behavior (and maybe make
328 328
         // debugging easier).
329
-        mucNickname = Strophe.getNodeFromJid(jid).substr(0, 8)
329
+        mucNickname = Strophe.getNodeFromJid(jid)?.substr(0, 8)
330 330
             .toLowerCase();
331 331
 
332 332
         // But if this doesn't have the required format we just generate a new
333 333
         // random nickname.
334 334
         const re = /[0-9a-f]{8}/g;
335 335
 
336
-        if (!re.test(mucNickname)) {
336
+        if (!mucNickname || !re.test(mucNickname)) {
337 337
             mucNickname = RandomUtil.randomHexString(8).toLowerCase();
338 338
         }
339 339
     }

Loading…
취소
저장