Main: check the g_get_user_special_dir() result
Fixes crash.
This commit is contained in:
parent
216e37bf33
commit
a88c23b6e8
11
src/Main.cxx
11
src/Main.cxx
@ -135,10 +135,13 @@ 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 (music_dir.IsNull())
|
if (path != nullptr) {
|
||||||
return false;
|
music_dir = AllocatedPath::FromUTF8(path, error);
|
||||||
|
if (music_dir.IsNull())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mapper_init(std::move(music_dir), std::move(playlist_dir));
|
mapper_init(std::move(music_dir), std::move(playlist_dir));
|
||||||
|
Loading…
Reference in New Issue
Block a user