List: avoid runtime exception by ensuring item height is always at least 1

This commit is contained in:
Jonathan Daugherty 2016-08-27 09:50:31 -07:00
parent de871d1d33
commit fdbba5db53

View File

@ -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.