Fix crashes when process list is empty

This commit is contained in:
Hisham Muhammad
2012-03-05 11:18:27 +00:00
parent 368cb1fe20
commit bca656c79e
3 changed files with 30 additions and 11 deletions

View File

@ -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) {