diff --git a/js/ui/panel.js b/js/ui/panel.js index fd499f863..df8fe1160 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -533,6 +533,9 @@ class PanelCorner extends St.DrawingArea { if (index < 0) return null; + if (!(children[index] instanceof St.Widget)) + return null; + if (!children[index].has_style_class_name('panel-menu') && !children[index].has_style_class_name('panel-button')) return this._findRightmostButton(children[index]); @@ -558,6 +561,9 @@ class PanelCorner extends St.DrawingArea { if (index == children.length) return null; + if (!(children[index] instanceof St.Widget)) + return null; + if (!children[index].has_style_class_name('panel-menu') && !children[index].has_style_class_name('panel-button')) return this._findLeftmostButton(children[index]);