view.c: next_toplevel(): handle NULL pointer

This commit is contained in:
Johan Malm 2020-06-10 16:48:25 +01:00
parent cb9cb384e4
commit 49d2e029aa
2 changed files with 2 additions and 2 deletions

View file

@ -175,7 +175,8 @@ struct view *view_front_toplevel(struct server *server)
struct view *next_toplevel(struct view *current)
{
/* FIXME: write nr_toplevels() */
if (!current)
return NULL;
struct view *view = current;
do {
view = wl_container_of(view->link.next, view, link);