mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
Assert Vector_get returns an object
It is generally assumed Vector_get returns a non-NULL object. Use a generic assert in Vector_get instead of in callers.
This commit is contained in:
parent
742e610f1d
commit
0806a7958b
2
Panel.c
2
Panel.c
@ -261,7 +261,6 @@ void Panel_draw(Panel* this, bool focus) {
|
||||
int line = 0;
|
||||
for(int i = first; line < h && i < upTo; i++) {
|
||||
Object* itemObj = Vector_get(this->items, i);
|
||||
assert(itemObj); if(!itemObj) continue;
|
||||
RichString_begin(item);
|
||||
Object_display(itemObj, &item);
|
||||
int itemLen = RichString_sizeVal(item);
|
||||
@ -288,7 +287,6 @@ void Panel_draw(Panel* this, bool focus) {
|
||||
|
||||
} else {
|
||||
Object* oldObj = Vector_get(this->items, this->oldSelected);
|
||||
assert(oldObj);
|
||||
RichString_begin(old);
|
||||
Object_display(oldObj, &old);
|
||||
int oldLen = RichString_sizeVal(old);
|
||||
|
Loading…
Reference in New Issue
Block a user