mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03: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;
|
char *errmsg;
|
||||||
int status = sqlite3_exec(m_database,
|
int status = sqlite3_exec(m_database,
|
||||||
"SELECT `modname` FROM `entries` GROUP BY `modname`;",
|
"SELECT `modname` FROM `entries` GROUP BY `modname`;",
|
||||||
[](void *res_vp, int n_col, char **cols, char **col_names) -> int {
|
[](void *res_vp, int n_col, char **cols, char **col_names) noexcept -> int {
|
||||||
((decltype(res)) res_vp)->emplace_back(cols[0]);
|
try {
|
||||||
|
((decltype(res)) res_vp)->emplace_back(cols[0]);
|
||||||
|
} catch (...) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}, (void *) res, &errmsg);
|
}, (void *) res, &errmsg);
|
||||||
if (status != SQLITE_OK) {
|
if (status != SQLITE_OK) {
|
||||||
|
Loading…
Reference in New Issue
Block a user