[gnome-shell/wip/exalm/query-exists] background: Handle errors when loading wallpapers




commit 5bb13f3ed1f33de7147fa3c02d1b829f6c46c327
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sat Feb 12 18:33:51 2022 +0500

    background: Handle errors when loading wallpapers
    
    Since it happens while setting up the startup animation, we will get stuck
    inside that animation and block input if it fails.
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5062

 js/ui/background.js | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/background.js b/js/ui/background.js
index 21359d0a83..0b53f3fd05 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -496,11 +496,17 @@ var Background = GObject.registerClass({
     }
 
     async _loadFile(file) {
-        const info = await file.query_info_async(
-            Gio.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
-            Gio.FileQueryInfoFlags.NONE,
-            0,
-            null);
+        let info;
+        try {
+            info = await file.query_info_async(
+                Gio.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+                Gio.FileQueryInfoFlags.NONE,
+                0,
+                null);
+        } catch (e) {
+            this._setLoaded();
+            return;
+        }
 
         const contentType = info.get_content_type();
         if (contentType === 'application/xml')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]