From 2c7a0167ed4bc382d1150bd978c4899c93777ce4 Mon Sep 17 00:00:00 2001 From: jabahere Date: Sat, 25 Jan 2025 19:38:39 +0400 Subject: [PATCH] fix missing storage error --- src/persist-plugins/expo-sqlite.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/persist-plugins/expo-sqlite.ts b/src/persist-plugins/expo-sqlite.ts index dbab2581..708ce02b 100644 --- a/src/persist-plugins/expo-sqlite.ts +++ b/src/persist-plugins/expo-sqlite.ts @@ -11,9 +11,11 @@ export class ObservablePersistSqlite implements ObservablePersistPlugin { private data: Record = {}; private storage: SQLiteStorage; constructor(storage: SQLiteStorage) { - console.error( - '[legend-state] ObservablePersistSqlite failed to initialize. You need to pass the SQLiteStorage instance.', - ); + if (!storage) { + console.error( + '[legend-state] ObservablePersistSqlite failed to initialize. You need to pass the SQLiteStorage instance.', + ); + } this.storage = storage; } public getTable(table: string, init: any) {