summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2016-02-18 23:46:36 -0200
committerHisham Muhammad <hisham@gobolinux.org>2016-02-18 23:46:36 -0200
commit34431dc7fd3b383ffae8425baf68c05f6690a7b7 (patch)
tree4361417f59a51183bdf74ab084328b7daaa74043
parent42c4459375f81d690170c58cbb1078db8321fa30 (diff)
parent48254f92e4902ecd2b8ca27ae979b7d70e1ca804 (diff)
Merge branch 'master' of https://github.com/hishamhm/htop
-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) {