From 3c6ede1725a9464713529bc60a046d117c5e1ac1 Mon Sep 17 00:00:00 2001 From: farfromrefug Date: Tue, 17 Dec 2024 15:14:05 +0100 Subject: [PATCH] chore: prevent error if sync is called after db is closed --- app/services/sync.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/sync.ts b/app/services/sync.ts index f93d8391..537a250f 100644 --- a/app/services/sync.ts +++ b/app/services/sync.ts @@ -386,7 +386,8 @@ export class SyncService extends Observable { event?: DocumentEvents; } = {}) { try { - if (!this.enabled) { + const db = documentsService.db?.db?.db; + if (!this.enabled || !db) { return; } // send syncState event right now for the UI to be updated as soon as possible