Skip to content

Commit

Permalink
vxfw(ListView): bounds check slice
Browse files Browse the repository at this point in the history
  • Loading branch information
rockorager committed Nov 12, 2024
1 parent 1fd920a commit 6d729a2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/vxfw/ListView.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
Expand Down

0 comments on commit 6d729a2

Please sign in to comment.