Commit 48254f92 authored by Hisham's avatar Hisham
Browse files

Fix behavior of Panel on empty lists.

Closes #370.
parent 5ee67158
...@@ -441,7 +441,7 @@ bool Panel_onKey(Panel* this, int key) { ...@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment