[gnome-shell/wip/rstrode/login-screen-extensions: 112/134] popupMenu: Guard against non-menu-item children




commit 55771d8690fe8320388c1efaa1616c89683f1066
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Jun 9 19:42:21 2020 +0200

    popupMenu: Guard against non-menu-item children
    
    This avoid a harmless but annoying warning.

 js/ui/popupMenu.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index badde35bdc..d30c15788c 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -696,7 +696,8 @@ var PopupMenuBase = class {
     }
 
     _getMenuItems() {
-        return this.box.get_children().map(a => a._delegate).filter(item => {
+        const children = this.box.get_children().filter(a => a._delegate !== undefined);
+        return children.map(a => a._delegate).filter(item => {
             return item instanceof PopupBaseMenuItem || item instanceof PopupMenuSection;
         });
     }


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