From 1068bca2852942bce0015c9746b19f8f7ccfb805 Mon Sep 17 00:00:00 2001 From: Dylan McCall Date: Wed, 31 Jan 2024 17:45:58 -0800 Subject: [PATCH] appDisplay: Handle an error moving nonexistent app icons With the added set of application aliases, it is possible that BaseAppGridViewLayout._redisplay will call _moveItem for an application which is no longer present in the icon grid. This requires an unusual series of events, so for simplicity, we will simply log the exception and carry on. https://phabricator.endlessm.com/T34672 --- js/ui/appDisplay.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index d0c8eca59e..18ffb18659 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1102,7 +1102,11 @@ var BaseAppView = GObject.registerClass({ if (addedApps.includes(icon)) this._addItem(icon, page, position); else if (page !== -1 && position !== -1) - this._moveItem(icon, page, position); + try { + this._moveItem(icon, page, position); + } catch (error) { + log(`Error moving app icon: ${error.message}`); + } }); this.emit('view-loaded');