mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Fix crashes when process list is empty
This commit is contained in:
6
Panel.c
6
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) {
|
||||
|
Reference in New Issue
Block a user