aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Main.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index ba1c83f6e..f27de84ec 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -135,10 +135,13 @@ glue_mapper_init(Error &error)
return false;
if (music_dir.IsNull()) {
- music_dir = AllocatedPath::FromUTF8(g_get_user_special_dir(G_USER_DIRECTORY_MUSIC),
- error);
- if (music_dir.IsNull())
- return false;
+ const char *path =
+ g_get_user_special_dir(G_USER_DIRECTORY_MUSIC);
+ if (path != nullptr) {
+ music_dir = AllocatedPath::FromUTF8(path, error);
+ if (music_dir.IsNull())
+ return false;
+ }
}
mapper_init(std::move(music_dir), std::move(playlist_dir));