mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 00:28:27 +02:00
Fix a crasher when launching an application whose icon is corrupt
It is possible for OPK links to refer to a missing icon or to an icon that cannot be read as a PNG file, in which cases there is no fallback to icons/generic.png and the icon is null. Link::paint checks for this, but LinkApp::drawLaunch did not. Obviously it is more desirable to properly fall back, but that would be a very big change to many areas of the code, so this is a quick fix.
This commit is contained in:
parent
b938c41067
commit
5758209170
@ -398,7 +398,9 @@ void LinkApp::drawLaunch(Surface& s) {
|
||||
gmenu2x->sc[getIcon()]->blit(gmenu2x->s,x,104);
|
||||
else
|
||||
gmenu2x->sc["icons/generic.png"]->blit(gmenu2x->s,x,104);*/
|
||||
iconSurface->blit(s, x, gmenu2x->halfY - 16);
|
||||
if (iconSurface) {
|
||||
iconSurface->blit(s, x, gmenu2x->halfY - 16);
|
||||
}
|
||||
gmenu2x->font->write(s, text, x + 42, gmenu2x->halfY + 1, Font::HAlignLeft, Font::VAlignMiddle);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user