Check if player has widget before trying to focus it

This commit is contained in:
Rafostar
2020-12-15 18:16:59 +01:00
parent 7431f58034
commit 4c6e5607fb

View File

@@ -123,7 +123,13 @@ class ClapperHeaderBarPopover extends Gtk.PopoverMenu
let root = this.get_root();
let clapperWidget = root.get_child();
if(clapperWidget && clapperWidget.player)
clapperWidget.player.widget.grab_focus();
if(
!clapperWidget
|| !clapperWidget.player
|| !clapperWidget.player.widget
)
return;
clapperWidget.player.widget.grab_focus();
}
});