summaryrefslogtreecommitdiffstats
path: root/Panel.c
diff options
context:
space:
mode:
authorHisham <hisham@gobolinux.org>2016-02-18 17:45:04 -0200
committerHisham <hisham@gobolinux.org>2016-02-18 17:45:04 -0200
commit48254f92e4902ecd2b8ca27ae979b7d70e1ca804 (patch)
tree5e3afca9e38d043d8a9618e3e770e1300dbbedbe /Panel.c
parent5ee6715843902da1aa40782a9d00f41ca855a2ee (diff)
Fix behavior of Panel on empty lists.
Closes #370.
Diffstat (limited to 'Panel.c')
-rw-r--r--Panel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Panel.c b/Panel.c
index dd94ceae..1c45714f 100644
--- a/Panel.c
+++ b/Panel.c
@@ -441,7 +441,7 @@ bool Panel_onKey(Panel* this, int key) {
}
// ensure selection within bounds
- if (this->selected < 0) {
+ if (this->selected < 0 || size == 0) {
this->selected = 0;
this->needsRedraw = true;
} else if (this->selected >= size) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy