[gnome-shell-extensions/gnome-3-18] apps-menu: Catch menu tree entries we can't resolve to an app



commit 2383462a6072cc1c22625a1c5c73d29636c566f5
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Feb 22 16:48:55 2016 +0100

    apps-menu: Catch menu tree entries we can't resolve to an app
    
    The default .menu file still contains a number of legacy directories that
    have been deprecated for over 15 years, which GIO (and in extension the
    shell's AppSystem) ignore. Encountering such an entry currently triggers
    an exception and an entire category ends up empty, fix this by silently
    skipping over the offending entry.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759004

 extensions/apps-menu/extension.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
index 796d235..aea1f99 100644
--- a/extensions/apps-menu/extension.js
+++ b/extensions/apps-menu/extension.js
@@ -404,7 +404,7 @@ const ApplicationsButton = new Lang.Class({
                     continue;
                 }
                 let app = appSys.lookup_app(id);
-                if (app.get_app_info().should_show())
+                if (app && app.get_app_info().should_show())
                     this.applicationsByCategory[categoryId].push(app);
             } else if (nextType == GMenu.TreeItemType.DIRECTORY) {
                 let subdir = iter.get_directory();


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