Skip to content

Commit 3ee6a29

Browse files
search-tool: Check directory existence more carefully
Handle nullptr explicitly to prevent a GLib-CRITICAL runtime error.
1 parent edac6ea commit 3ee6a29

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/search-tool/search-tool.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static String get_uri ()
9999
return strstr (path1, "://") ? path1 : to_uri (path1);
100100

101101
const char * path2 = g_get_user_special_dir (G_USER_DIRECTORY_MUSIC);
102-
if (g_file_test (path2, G_FILE_TEST_EXISTS))
102+
if (path2 && g_file_test (path2, G_FILE_TEST_EXISTS))
103103
return to_uri (path2);
104104

105105
return to_uri (g_get_home_dir ());

0 commit comments

Comments
 (0)