Skip to content

Commit

Permalink
commands/move: Fix crash when pos_y is omitted
Browse files Browse the repository at this point in the history
  • Loading branch information
David96 committed Jan 8, 2022
1 parent f923297 commit d9292bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sway/commands/move.c
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,10 @@ static struct cmd_results *cmd_move_to_position(int argc, char **argv) {
return cmd_results_new(CMD_INVALID, "Invalid x position specified");
}

if (argc < 2) {
return cmd_results_new(CMD_FAILURE, expected_position_syntax);
}

struct movement_amount ly = { .amount = 0, .unit = MOVEMENT_UNIT_INVALID };
// Y direction
num_consumed_args = parse_movement_amount(argc, argv, &ly);
Expand Down

0 comments on commit d9292bd

Please sign in to comment.