Background: don't require a URI scheme for picture-uri
Migration from old settings can result in a path instead of URI there. This is technically invalid, but can easily recognize it and avoid the crash. Minor changes by Ray Strode https://bugzilla.gnome.org/show_bug.cgi?id=702121
This commit is contained in:
parent
5ee6cbd4c8
commit
798a0ca240
@ -571,7 +571,16 @@ const Background = new Lang.Class({
|
|||||||
}
|
}
|
||||||
|
|
||||||
let uri = this._settings.get_string(PICTURE_URI_KEY);
|
let uri = this._settings.get_string(PICTURE_URI_KEY);
|
||||||
let filename = Gio.File.new_for_uri(uri).get_path();
|
let filename;
|
||||||
|
if (GLib.uri_parse_scheme(uri) != null)
|
||||||
|
filename = Gio.File.new_for_uri(uri).get_path();
|
||||||
|
else
|
||||||
|
filename = uri;
|
||||||
|
|
||||||
|
if (!filename) {
|
||||||
|
this._setLoaded();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this._loadFile(filename);
|
this._loadFile(filename);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user