[Crash] Fix crash issue during database dump (#4127)

This commit is contained in:
Chris Miles 2024-02-28 19:36:06 -06:00 committed by GitHub
parent 103a37e762
commit aa0ca88d9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -575,8 +575,13 @@ void DatabaseDumpService::RemoveSqlBackup()
{
std::string file = fmt::format("{}.sql", GetDumpFileNameWithPath());
if (File::Exists(file)) {
try {
std::filesystem::remove(file);
}
catch (std::exception &e) {
LogError("std::filesystem::remove err [{}]", e.what());
}
}
RemoveCredentialsFile();
}