Skip to content

Commit

Permalink
chore: prevent error if sync is called after db is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Dec 17, 2024
1 parent 7a207e5 commit 3c6ede1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/services/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3c6ede1

Please sign in to comment.