diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2012-03-05 11:18:27 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2012-03-05 11:18:27 +0000 |
commit | bca656c79e184fb044ad9f71c323070d25623486 (patch) | |
tree | 8577a1f830de3f426edaeb96fa3ed6998dfad81d /Panel.c | |
parent | 368cb1fe20b66b91389f834019e2c2c18bdae8b7 (diff) |
Fix crashes when process list is empty
Diffstat (limited to 'Panel.c')
-rw-r--r-- | Panel.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) { |