Commit a88c23b6 authored by Max Kellermann's avatar Max Kellermann

Main: check the g_get_user_special_dir() result

Fixes crash.
parent 216e37bf
...@@ -135,11 +135,14 @@ glue_mapper_init(Error &error) ...@@ -135,11 +135,14 @@ glue_mapper_init(Error &error)
return false; return false;
if (music_dir.IsNull()) { if (music_dir.IsNull()) {
music_dir = AllocatedPath::FromUTF8(g_get_user_special_dir(G_USER_DIRECTORY_MUSIC), const char *path =
error); g_get_user_special_dir(G_USER_DIRECTORY_MUSIC);
if (path != nullptr) {
music_dir = AllocatedPath::FromUTF8(path, error);
if (music_dir.IsNull()) if (music_dir.IsNull())
return false; return false;
} }
}
mapper_init(std::move(music_dir), std::move(playlist_dir)); mapper_init(std::move(music_dir), std::move(playlist_dir));
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment