aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-31 23:14:13 +0100
committerMax Kellermann <max@duempel.org>2014-01-31 23:14:13 +0100
commitff650d50a21032c13c66f5514892276f67b2468a (patch)
tree917b47f02543317b6d6d715d7f91414802d71917
parent78689645dcedbe0f7da89d1108193141f0e9eeb6 (diff)
downloadmpd-ff650d50a21032c13c66f5514892276f67b2468a.tar.gz
mpd-ff650d50a21032c13c66f5514892276f67b2468a.tar.xz
mpd-ff650d50a21032c13c66f5514892276f67b2468a.zip
Mapper: assert that Song::parent is not nullptr
-rw-r--r--src/Mapper.cxx21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/Mapper.cxx b/src/Mapper.cxx
index 8d9544932..60928dbb9 100644
--- a/src/Mapper.cxx
+++ b/src/Mapper.cxx
@@ -225,21 +225,6 @@ map_directory_child_fs(const Directory &directory, const char *name)
return AllocatedPath::Build(parent_fs, name_fs);
}
-/**
- * Map a song object that was created by song_dup_detached(). It does
- * not have a real parent directory, only the dummy object
- * #detached_root.
- */
-static AllocatedPath
-map_detached_song_fs(const char *uri_utf8)
-{
- auto uri_fs = AllocatedPath::FromUTF8(uri_utf8);
- if (uri_fs.IsNull())
- return uri_fs;
-
- return AllocatedPath::Build(music_dir_fs, uri_fs);
-}
-
DetachedSong
map_song_detach(const LightSong &song)
{
@@ -257,9 +242,9 @@ map_song_detach(const LightSong &song)
AllocatedPath
map_song_fs(const Song &song)
{
- return song.parent == nullptr
- ? map_detached_song_fs(song.uri)
- : map_directory_child_fs(*song.parent, song.uri);
+ assert(song.parent != nullptr);
+
+ return map_directory_child_fs(*song.parent, song.uri);
}
#endif