summaryrefslogtreecommitdiffstats
path: root/Panel.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2012-03-05 11:18:27 +0000
committerHisham Muhammad <hisham@gobolinux.org>2012-03-05 11:18:27 +0000
commitbca656c79e184fb044ad9f71c323070d25623486 (patch)
tree8577a1f830de3f426edaeb96fa3ed6998dfad81d /Panel.c
parent368cb1fe20b66b91389f834019e2c2c18bdae8b7 (diff)
Fix crashes when process list is empty
Diffstat (limited to 'Panel.c')
-rw-r--r--Panel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Panel.c b/Panel.c
index b090c525..e8de2b86 100644
--- a/Panel.c
+++ b/Panel.c
@@ -199,8 +199,10 @@ Object* Panel_remove(Panel* this, int i) {
Object* Panel_getSelected(Panel* this) {
assert (this != NULL);
-
- return Vector_get(this->items, this->selected);
+ if (Vector_size(this->items) > 0)
+ return Vector_get(this->items, this->selected);
+ else
+ return NULL;
}
void Panel_moveSelectedUp(Panel* this) {

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