Commit 233b8d01 authored by Max Kellermann's avatar Max Kellermann

sticker/Song: catch Database::GetSong() exceptions

parent f55bdf07
...@@ -92,10 +92,13 @@ sticker_song_find_cb(const char *uri, const char *value, void *user_data) ...@@ -92,10 +92,13 @@ sticker_song_find_cb(const char *uri, const char *value, void *user_data)
return; return;
const Database *db = data->db; const Database *db = data->db;
const LightSong *song = db->GetSong(uri, IgnoreError()); try {
if (song != nullptr) { const LightSong *song = db->GetSong(uri, IgnoreError());
data->func(*song, value, data->user_data); if (song != nullptr) {
db->ReturnSong(song); data->func(*song, value, data->user_data);
db->ReturnSong(song);
}
} catch (const std::runtime_error &e) {
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment