mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 01:53:45 +01:00
Catch exceptions in SQLite3 callback
This commit is contained in:
parent
b89608c624
commit
006d974c58
@ -857,8 +857,12 @@ void ModMetadataDatabaseSQLite3::listMods(std::vector<std::string> *res)
|
||||
char *errmsg;
|
||||
int status = sqlite3_exec(m_database,
|
||||
"SELECT `modname` FROM `entries` GROUP BY `modname`;",
|
||||
[](void *res_vp, int n_col, char **cols, char **col_names) -> int {
|
||||
((decltype(res)) res_vp)->emplace_back(cols[0]);
|
||||
[](void *res_vp, int n_col, char **cols, char **col_names) noexcept -> int {
|
||||
try {
|
||||
((decltype(res)) res_vp)->emplace_back(cols[0]);
|
||||
} catch (...) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}, (void *) res, &errmsg);
|
||||
if (status != SQLITE_OK) {
|
||||
|
Loading…
Reference in New Issue
Block a user