From 7b173fe8eba8cd871deecccba97a852f50803406 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Wed, 24 Aug 2022 16:03:21 +0530 Subject: [PATCH] error prop may not always exist --- src/domain/session/SessionViewModel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/domain/session/SessionViewModel.js b/src/domain/session/SessionViewModel.js index bfd0251a..3373dbab 100644 --- a/src/domain/session/SessionViewModel.js +++ b/src/domain/session/SessionViewModel.js @@ -99,7 +99,7 @@ export class SessionViewModel extends ViewModel { this._client.sync.status.subscribe(status => { if (status === SyncStatus.Stopped) { const error = this._client.sync.error; - if (error.errcode === "M_UNKNOWN_TOKEN") { + if (error?.errcode === "M_UNKNOWN_TOKEN") { // Access token is no longer valid, so force the user to log out const segments = [ this.navigation.segment("logout", this.id),