mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-05 06:58:27 +02: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:
parent
fb8f4e6e72
commit
dd55b7290b
@ -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 );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user