Skip to content

Commit 3b311fb

Browse files
committed
BackgroundSource: fix log spam
1 parent 5da04b9 commit 3b311fb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Background/BackgroundSource.vala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,22 @@ public class Gala.BackgroundSource : Object {
116116
return background;
117117
}
118118

119-
private string get_background_path () {
119+
private string? get_background_path () {
120120
if (Drawing.StyleManager.get_instance ().prefers_color_scheme == DARK) {
121121
var uri = gnome_background_settings.get_string ("picture-uri-dark");
122122
var path = File.new_for_uri (uri).get_path ();
123-
if (FileUtils.test (path, EXISTS)) {
123+
if (path != null && FileUtils.test (path, EXISTS)) {
124124
return path;
125125
}
126126
}
127127

128128
var uri = gnome_background_settings.get_string ("picture-uri");
129129
var path = File.new_for_uri (uri).get_path ();
130-
if (FileUtils.test (path, EXISTS)) {
130+
if (path != null && FileUtils.test (path, EXISTS)) {
131131
return path;
132132
}
133133

134-
return uri;
134+
return null;
135135
}
136136

137137
private void background_changed (Background background) {

0 commit comments

Comments
 (0)