From a8491eb13e18ed7d9f69229ac0930a0255834d35 Mon Sep 17 00:00:00 2001 From: Peter Kaplan Date: Thu, 14 Apr 2022 19:50:49 +0200 Subject: [PATCH] command/hide-cursor: fix crash on missing option --- river/command/cursor.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/river/command/cursor.zig b/river/command/cursor.zig index efa2b2c..33b7b50 100644 --- a/river/command/cursor.zig +++ b/river/command/cursor.zig @@ -30,6 +30,7 @@ pub fn cursor( args: []const [:0]const u8, _: *?[]const u8, ) Error!void { + if (args.len < 2) return Error.NotEnoughArguments; if (std.mem.eql(u8, "timeout", args[1])) { if (args.len < 3) return Error.NotEnoughArguments; if (args.len > 3) return Error.TooManyArguments;