fix(electron): not starting on an empty DB

This commit is contained in:
--global 2025-03-26 18:41:36 +02:00
parent 1e713469e7
commit 0cedd697cc
No known key found for this signature in database

View File

@ -25,7 +25,12 @@ function getOptionOrNull(name: OptionNames): string | null {
option = becca.getOption(name); option = becca.getOption(name);
} else { } else {
// e.g. in initial sync becca is not loaded because DB is not initialized // e.g. in initial sync becca is not loaded because DB is not initialized
option = sql.getRow<OptionRow>("SELECT * FROM options WHERE name = ?", [name]); try {
option = sql.getRow<OptionRow>("SELECT * FROM options WHERE name = ?", [name]);
} catch (e: unknown) {
// DB is not initialized.
return null;
}
} }
return option ? option.value : null; return option ? option.value : null;