don't draw if icon is not valid

This commit is contained in:
Julien Danjou 2008-01-17 13:45:24 +01:00
parent c248d9afca
commit b3f1b213a6
1 changed files with 4 additions and 0 deletions

View File

@ -37,6 +37,10 @@ iconbox_draw(Widget *widget, DrawCtx *ctx, int offset,
Data *d = widget->data;
Area area = draw_get_image_size(d->image);
/* image not valid */
if(area.width < 0 || area.height < 0)
return (widget->area.width = 0);
if(d->resize)
widget->area.width = ((double) widget->statusbar->height / area.height) * area.width;
else