diff --git a/src/services/options.ts b/src/services/options.ts index a5516df1a..3d54fde5f 100644 --- a/src/services/options.ts +++ b/src/services/options.ts @@ -25,7 +25,12 @@ function getOptionOrNull(name: OptionNames): string | null { option = becca.getOption(name); } else { // e.g. in initial sync becca is not loaded because DB is not initialized - option = sql.getRow("SELECT * FROM options WHERE name = ?", [name]); + try { + option = sql.getRow("SELECT * FROM options WHERE name = ?", [name]); + } catch (e: unknown) { + // DB is not initialized. + return null; + } } return option ? option.value : null;