mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +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);
|
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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user