diff options
author | Max Kellermann <max@duempel.org> | 2016-03-19 00:16:01 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2016-03-19 00:16:01 +0100 |
commit | 6d1710c74f7f9ecbffe50dade5bd836db3e2d7ff (patch) | |
tree | d44c7ed0bbe0dabcc61a312da739ce39996da977 /src/PlaylistPrint.cxx | |
parent | 233b8d0129a43c8dcd61793dd3df69849a7becef (diff) |
PlaylistPrint: catch Database::GetSong() exceptions
Diffstat (limited to 'src/PlaylistPrint.cxx')
-rw-r--r-- | src/PlaylistPrint.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/PlaylistPrint.cxx b/src/PlaylistPrint.cxx index 2e5804da4..e04d2cab9 100644 --- a/src/PlaylistPrint.cxx +++ b/src/PlaylistPrint.cxx @@ -125,9 +125,14 @@ PrintSongDetails(Response &r, Partition &partition, const char *uri_utf8) if (db == nullptr) return false; - auto *song = db->GetSong(uri_utf8, IgnoreError()); - if (song == nullptr) + const LightSong *song; + try { + song = db->GetSong(uri_utf8, IgnoreError()); + if (song == nullptr) + return false; + } catch (const std::runtime_error &e) { return false; + } song_print_info(r, partition, *song); db->ReturnSong(song); |