aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Mapper.cxx4
-rw-r--r--src/Mapper.hxx3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/Mapper.cxx b/src/Mapper.cxx
index 08597732a..cbe45daa0 100644
--- a/src/Mapper.cxx
+++ b/src/Mapper.cxx
@@ -133,7 +133,9 @@ void mapper_finish(void)
const char *
mapper_get_music_directory_utf8(void)
{
- return music_dir_utf8.c_str();
+ return music_dir_utf8.empty()
+ ? nullptr
+ : music_dir_utf8.c_str();
}
const AllocatedPath &
diff --git a/src/Mapper.hxx b/src/Mapper.hxx
index be69a7110..947fd2822 100644
--- a/src/Mapper.hxx
+++ b/src/Mapper.hxx
@@ -41,7 +41,8 @@ mapper_init(AllocatedPath &&music_dir, AllocatedPath &&playlist_dir);
void mapper_finish(void);
/**
- * Return the absolute path of the music directory encoded in UTF-8.
+ * Return the absolute path of the music directory encoded in UTF-8 or
+ * nullptr if no music directory was configured.
*/
gcc_const
const char *