fix a panic and handle cleaning up after a panic

This commit is contained in:
2021-07-28 21:06:49 -04:00
parent c2d2fe25c0
commit 4f4758f7fe
3 changed files with 18 additions and 0 deletions

View File

@@ -296,6 +296,9 @@ func (l *List) Selected() int {
}
func (l *List) SelectedID() int {
if l.listItems == nil || len(l.listItems) == 0 {
return 0
}
return l.listItems[l.selected].Key
}