From 941419e165d60c0a95d4e73310f4f88b1a03a5d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 13 Aug 2021 03:02:05 +0200 Subject: [PATCH] appDisplay: Fix dead error handling gjs includes an override to turn GSettings' asserts into exceptions, but we'll have to catch that instead of checking for a null return value. Spotted by coverity in CID 351268. Part-of: --- js/ui/appDisplay.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 012e88bd0..3673c8541 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1831,11 +1831,13 @@ class AppDisplay extends BaseAppView { // Create the new folder let newFolderPath = this._folderSettings.path.concat('folders/', newFolderId, '/'); - let newFolderSettings = new Gio.Settings({ - schema_id: 'org.gnome.desktop.app-folders.folder', - path: newFolderPath, - }); - if (!newFolderSettings) { + let newFolderSettings; + try { + newFolderSettings = new Gio.Settings({ + schema_id: 'org.gnome.desktop.app-folders.folder', + path: newFolderPath, + }); + } catch (e) { log('Error creating new folder'); return false; }