[gnome-shell/gnome-3-34] appDisplay: Don't crash if app is missing categories



commit 8d2365b7b93275b740eba75c6680c1892857feef
Author: Philip Chimento <philip endlessm com>
Date:   Fri Oct 25 15:27:25 2019 -0700

    appDisplay: Don't crash if app is missing categories
    
    g_desktop_app_info_get_categories() may return null. In that case, the
    previous code would fail to create a folder when dragging an app with
    no categories onto another app. Instead, simply continue with the next
    app info.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/782

 js/ui/appDisplay.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index c10ff33195..09f28d9443 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -97,7 +97,10 @@ function _findBestFolderName(apps) {
     let commonCategories = [];
 
     appInfos.reduce((categories, appInfo) => {
-        for (let category of appInfo.get_categories().split(';')) {
+        const appCategories = appInfo.get_categories();
+        if (!appCategories)
+            return categories;
+        for (let category of appCategories.split(';')) {
             if (!(category in categoryCounter))
                 categoryCounter[category] = 0;
 


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