Prevent missing direction arguments to segfault labwc

Reported-by: @Flrian
Backport of 986ab70780
This commit is contained in:
Consolatis 2022-06-03 02:19:31 +02:00
parent e5a511668e
commit 6f13ae2449
2 changed files with 20 additions and 2 deletions

View file

@ -178,10 +178,18 @@ action(struct view *activator, struct server *server, struct wl_list *actions, u
wl_display_terminate(server->wl_display);
break;
case ACTION_TYPE_MOVE_TO_EDGE:
view_move_to_edge(view, action->arg);
if (action->arg) {
view_move_to_edge(view, action->arg);
} else {
wlr_log(WLR_ERROR, "Missing argument for MoveToEdge");
}
break;
case ACTION_TYPE_SNAP_TO_EDGE:
view_snap_to_edge(view, action->arg);
if (action->arg) {
view_snap_to_edge(view, action->arg);
} else {
wlr_log(WLR_ERROR, "Missing argument for SnapToEdge");
}
break;
case ACTION_TYPE_NEXT_WINDOW:
server->cycle_view =