Commit f7b0cf5 1 parent b1695e2 commit f7b0cf5 Copy full SHA for f7b0cf5
File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -501,10 +501,16 @@ export class GroupCall extends EventEmitter {
501
501
const localUserId = this . client . getUserId ( ) ;
502
502
503
503
const currentStateEvent = this . room . currentState . getStateEvents ( EventType . GroupCallMemberPrefix , localUserId ) ;
504
+ const memberStateEvent = currentStateEvent ?. getContent < IGroupCallRoomMemberState > ( ) ;
504
505
505
- const calls = currentStateEvent ?. getContent < IGroupCallRoomMemberState > ( ) [ "m.calls" ] || [ ] ;
506
-
507
- const existingCallIndex = calls . findIndex ( ( call ) => call [ "m.call_id" ] === this . groupCallId ) ;
506
+ let calls : IGroupCallRoomMemberCallState [ ] = [ ] ;
507
+ let existingCallIndex : number ;
508
+ if ( memberCallState ) {
509
+ calls = memberStateEvent [ "m.calls" ] || [ ] ;
510
+ existingCallIndex = calls . findIndex ( ( call ) => call && call [ "m.call_id" ] === this . groupCallId ) ;
511
+ } else {
512
+ existingCallIndex = 0 ;
513
+ }
508
514
509
515
if ( existingCallIndex === - 1 ) {
510
516
calls . push ( memberCallState ) ;
You can’t perform that action at this time.
0 commit comments