Mapper: convert IsInDatabase() check to assertion in map_song_detach()

This commit is contained in:
Max Kellermann 2014-02-07 00:29:59 +01:00
parent 746a47982b
commit 19a982cf69

View File

@ -238,8 +238,9 @@ DetachedSong
map_song_detach(const LightSong &song) map_song_detach(const LightSong &song)
{ {
DetachedSong detached(song); DetachedSong detached(song);
assert(detached.IsInDatabase());
if (detached.IsInDatabase() && !detached.HasRealURI()) { if (!detached.HasRealURI()) {
const auto uri = song.GetURI(); const auto uri = song.GetURI();
detached.SetRealURI(PathTraitsUTF8::Build(music_dir_utf8.c_str(), detached.SetRealURI(PathTraitsUTF8::Build(music_dir_utf8.c_str(),
uri.c_str())); uri.c_str()));