Fix behavior of Panel on empty lists.

Closes #370.
This commit is contained in:
Hisham 2016-02-18 17:45:04 -02:00
parent 5ee6715843
commit 48254f92e4
1 changed files with 1 additions and 1 deletions

View File

@ -441,7 +441,7 @@ bool Panel_onKey(Panel* this, int key) {
} }
// ensure selection within bounds // ensure selection within bounds
if (this->selected < 0) { if (this->selected < 0 || size == 0) {
this->selected = 0; this->selected = 0;
this->needsRedraw = true; this->needsRedraw = true;
} else if (this->selected >= size) { } else if (this->selected >= size) {