mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
fix(electron): not starting on an empty DB
This commit is contained in:
parent
1e713469e7
commit
0cedd697cc
@ -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<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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user