menubar: Fix refresh without show

When menubar.refresh() is called, it tries to update the menubar widget.
The call chain looks like this: menulist_update -> common.list_update ->
get_current_page. get_current_page then tries to query information about
the size of the menubar.

Since there is not much point in this, just skip the whole callback in
this case.

Side note: What is the point of menubar.get()? It seems quite useless to
me.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2017-01-02 17:23:20 +01:00
parent 7f3ff5f26f
commit dadf8463bd
1 changed files with 3 additions and 1 deletions

View File

@ -350,7 +350,9 @@ end
function menubar.refresh(scr)
menubar.menu_gen.generate(function(entries)
menubar.menu_entries = entries
menulist_update(nil, scr)
if instance then
menulist_update(nil, scr)
end
end)
end