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 authored and RagnarGrootKoerkamp committed Mar 29, 2022
1 parent 3129326 commit 78b9630
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 < 1) {
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 78b9630

Please sign in to comment.