mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
fix: possible crash
This commit is contained in:
parent
2414e51a9b
commit
0e26b39faf
1 changed files with 11 additions and 5 deletions
|
@ -153,13 +153,19 @@ void moveCurrentDatabase() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void initialize() {
|
void initialize() {
|
||||||
const auto res = storage.sync_schema_simulate(true);
|
|
||||||
auto movePrevious = false;
|
auto movePrevious = false;
|
||||||
for (const auto val : res | std::views::values) {
|
|
||||||
if (val == sync_schema_result::dropped_and_recreated) {
|
try {
|
||||||
movePrevious = true;
|
const auto res = storage.sync_schema_simulate(true);
|
||||||
break;
|
for (const auto val : res | std::views::values) {
|
||||||
|
if (val == sync_schema_result::dropped_and_recreated) {
|
||||||
|
movePrevious = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (...) {
|
||||||
|
LOG(("Exception during sync simulation; possibly corrupted database"));
|
||||||
|
movePrevious = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (movePrevious) {
|
if (movePrevious) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue