mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-11-29 21:46:11 +03:00
List: avoid runtime exception by ensuring item height is always at least 1
This commit is contained in:
parent
de871d1d33
commit
fdbba5db53
@ -127,7 +127,8 @@ list :: n
|
||||
-> List n e
|
||||
list name es h =
|
||||
let selIndex = if V.null es then Nothing else Just 0
|
||||
in List es selIndex name h
|
||||
safeHeight = max 1 h
|
||||
in List es selIndex name safeHeight
|
||||
|
||||
-- | Turn a list state value into a widget given an item drawing
|
||||
-- function.
|
||||
|
Loading…
Reference in New Issue
Block a user