From 35abf39971f236c9e56150055eda914786aff812 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Thu, 13 Jun 2013 21:48:32 +0200 Subject: [PATCH] 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 --- js/ui/background.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/js/ui/background.js b/js/ui/background.js index f2ffce826..13343c6c8 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -590,7 +590,16 @@ const Background = new Lang.Class({ } 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); },