summaryrefslogtreecommitdiff
path: root/src/sticker
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-03-19 00:14:36 +0100
committerMax Kellermann <max@duempel.org>2016-03-19 00:14:40 +0100
commit233b8d0129a43c8dcd61793dd3df69849a7becef (patch)
treed72de297cb03f052186d1ea5fccec5c96e99a778 /src/sticker
parentf55bdf07d38652ba1eeab4ba4016ed5c6267d692 (diff)
sticker/Song: catch Database::GetSong() exceptions
Diffstat (limited to 'src/sticker')
-rw-r--r--src/sticker/SongSticker.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/sticker/SongSticker.cxx b/src/sticker/SongSticker.cxx
index 0ccedc249..121494af9 100644
--- a/src/sticker/SongSticker.cxx
+++ b/src/sticker/SongSticker.cxx
@@ -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) {
}
}