From 798a0ca240b90d557f42c76d8d9b14c73b1038e1 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 0e9c3aa95..1d9ab7c21 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -571,7 +571,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); },