vxfw(ListView): bounds check slice

This commit is contained in:
Tim Culverhouse 2024-11-12 13:57:42 -06:00
parent 1fd920a7ae
commit 6d729a2dc3

View file

@ -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);
},