From d414fb6b94ef5f08d10f2a6876731f6c3dede2d4 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 9 Apr 2021 19:50:22 +0200 Subject: [PATCH] sync can also stop without an error --- src/matrix/SessionContainer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/matrix/SessionContainer.js b/src/matrix/SessionContainer.js index 55acd4e7..07c4a870 100644 --- a/src/matrix/SessionContainer.js +++ b/src/matrix/SessionContainer.js @@ -241,13 +241,13 @@ export class SessionContainer { // keep waiting if there is a ConnectionError // as the reconnector above will call // sync.start again to retry in this case - return this._sync.error.name !== "ConnectionError"; + return this._sync.error?.name !== "ConnectionError"; } return s === SyncStatus.Syncing; }); try { await this._waitForFirstSyncHandle.promise; - if (this._sync.status.get() === SyncStatus.Stopped) { + if (this._sync.status.get() === SyncStatus.Stopped && this._sync.error) { throw this._sync.error; } } catch (err) {