Fix for screenshots when pictures path is unavailable

On my local jhbuild setup some local stuff is not set up and
there's no pictures folder. This fixes a regression where it
blew up instead of saving to the home dir in this situation.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1658>
This commit is contained in:
Brion Vibber 2019-12-18 14:34:45 -08:00 committed by Marge Bot
parent 86cefd906b
commit f9652aab82

View File

@ -84,7 +84,7 @@ var ScreenshotService = class {
let path = [ let path = [
GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES), GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES),
GLib.get_home_dir(), GLib.get_home_dir(),
].find(p => GLib.file_test(p, GLib.FileTest.EXISTS)); ].find(p => p && GLib.file_test(p, GLib.FileTest.EXISTS));
if (!path) if (!path)
return null; return null;