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

This commit is contained in:
Max Kellermann 2016-03-19 00:14:36 +01:00
parent f55bdf07d3
commit 233b8d0129

View File

@ -92,10 +92,13 @@ sticker_song_find_cb(const char *uri, const char *value, void *user_data)
return;
const Database *db = data->db;
const LightSong *song = db->GetSong(uri, IgnoreError());
if (song != nullptr) {
data->func(*song, value, data->user_data);
db->ReturnSong(song);
try {
const LightSong *song = db->GetSong(uri, IgnoreError());
if (song != nullptr) {
data->func(*song, value, data->user_data);
db->ReturnSong(song);
}
} catch (const std::runtime_error &e) {
}
}