ico: avoid potential nil pointer dereferences

Bgeticon can fail, leaving the Icon img pointers nil.
front
Alex Musolino 2020-12-15 20:45:26 +10:30
parent 81647c2025
commit 404c901f29
1 changed files with 2 additions and 0 deletions

View File

@ -535,6 +535,8 @@ eresized(int new)
r.max.x = screen->r.min.x;
r.min.y = screen->r.min.y + font->height + 2*BORDER;
for(icon = h.first; icon != nil; icon = icon->next){
if(icon->img == nil)
continue;
r.min.x = r.max.x + BORDER;
r.max.x = r.min.x + Dx(icon->img->r);
r.max.y = r.min.y + Dy(icon->img->r);