vxfw(ListView): bounds check slice
This commit is contained in:
parent
1fd920a7ae
commit
6d729a2dc3
1 changed files with 1 additions and 0 deletions
|
@ -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);
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue