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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1950>
This commit is contained in:
parent
6f7df32b0e
commit
941419e165
@ -1831,11 +1831,13 @@ class AppDisplay extends BaseAppView {
|
|||||||
|
|
||||||
// Create the new folder
|
// Create the new folder
|
||||||
let newFolderPath = this._folderSettings.path.concat('folders/', newFolderId, '/');
|
let newFolderPath = this._folderSettings.path.concat('folders/', newFolderId, '/');
|
||||||
let newFolderSettings = new Gio.Settings({
|
let newFolderSettings;
|
||||||
|
try {
|
||||||
|
newFolderSettings = new Gio.Settings({
|
||||||
schema_id: 'org.gnome.desktop.app-folders.folder',
|
schema_id: 'org.gnome.desktop.app-folders.folder',
|
||||||
path: newFolderPath,
|
path: newFolderPath,
|
||||||
});
|
});
|
||||||
if (!newFolderSettings) {
|
} catch (e) {
|
||||||
log('Error creating new folder');
|
log('Error creating new folder');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user