From fcc57bf2fc19fa48144aaed0be6c8789fb547028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sun, 26 Sep 2021 15:13:42 +0200 Subject: [PATCH] ignore non-existent sessions. --- src/component/internal/messages.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/component/internal/messages.ts b/src/component/internal/messages.ts index 958deb85..7c38f313 100644 --- a/src/component/internal/messages.ts +++ b/src/component/internal/messages.ts @@ -173,15 +173,19 @@ export class NekoMessages extends EventEmitter { } protected [EVENT.SESSION_PROFILE]({ id, ...profile }: message.MemberProfile) { - this._localLog.debug(`EVENT.SESSION_PROFILE`, { id }) - Vue.set(this._state.sessions[id], 'profile', profile) - this.emit('session.updated', id) + if (id in this._state.sessions) { + this._localLog.debug(`EVENT.SESSION_PROFILE`, { id }) + Vue.set(this._state.sessions[id], 'profile', profile) + this.emit('session.updated', id) + } } protected [EVENT.SESSION_STATE]({ id, ...state }: message.SessionState) { - this._localLog.debug(`EVENT.SESSION_STATE`, { id }) - Vue.set(this._state.sessions[id], 'state', state) - this.emit('session.updated', id) + if (id in this._state.sessions) { + this._localLog.debug(`EVENT.SESSION_STATE`, { id }) + Vue.set(this._state.sessions[id], 'state', state) + this.emit('session.updated', id) + } } /////////////////////////////