From 6d729a2dc3b934818dffe06d2ba3ce02841ed74b Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Tue, 12 Nov 2024 13:57:42 -0600 Subject: [PATCH] vxfw(ListView): bounds check slice --- src/vxfw/ListView.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vxfw/ListView.zig b/src/vxfw/ListView.zig index 4d2fa90..4cc3f3b 100644 --- a/src/vxfw/ListView.zig +++ b/src/vxfw/ListView.zig @@ -113,6 +113,7 @@ pub fn handleEvent(self: *ListView, ctx: *vxfw.EventContext, event: vxfw.Event) // All other keypresses go to our focused child switch (self.children) { .slice => |slice| { + if (slice.len == 0) return; const child = slice[self.cursor]; return child.handleEvent(ctx, event); },