ico: avoid potential nil pointer dereferences
Bgeticon can fail, leaving the Icon img pointers nil.
This commit is contained in:
parent
81647c2025
commit
404c901f29
|
@ -535,6 +535,8 @@ eresized(int new)
|
||||||
r.max.x = screen->r.min.x;
|
r.max.x = screen->r.min.x;
|
||||||
r.min.y = screen->r.min.y + font->height + 2*BORDER;
|
r.min.y = screen->r.min.y + font->height + 2*BORDER;
|
||||||
for(icon = h.first; icon != nil; icon = icon->next){
|
for(icon = h.first; icon != nil; icon = icon->next){
|
||||||
|
if(icon->img == nil)
|
||||||
|
continue;
|
||||||
r.min.x = r.max.x + BORDER;
|
r.min.x = r.max.x + BORDER;
|
||||||
r.max.x = r.min.x + Dx(icon->img->r);
|
r.max.x = r.min.x + Dx(icon->img->r);
|
||||||
r.max.y = r.min.y + Dy(icon->img->r);
|
r.max.y = r.min.y + Dy(icon->img->r);
|
||||||
|
|
Loading…
Reference in a new issue