1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-02 18:32:20 +03:00

Do not draw NULL icon

If for whatever reason no icon at all could be loaded, then skip
drawing the icon rather than crashing on the NULL pointer.
This commit is contained in:
Maarten ter Huurne 2013-07-31 19:13:30 +02:00
parent fb8f4e6e72
commit dd55b7290b

View File

@ -44,7 +44,9 @@ Link::Link(GMenu2X *gmenu2x_, Touchscreen &ts, function_t action_)
}
void Link::paint() {
iconSurface->blit(gmenu2x->s, iconX, rect.y+padding, 32,32);
if (iconSurface) {
iconSurface->blit(gmenu2x->s, iconX, rect.y+padding, 32,32);
}
gmenu2x->s->write( gmenu2x->font, getTitle(), iconX+16, rect.y+gmenu2x->skinConfInt["linkHeight"]-padding, ASFont::HAlignCenter, ASFont::VAlignBottom );
}