From dd55b7290bdd86299c571f132b3571f69ea1b08b Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Wed, 31 Jul 2013 19:13:30 +0200 Subject: [PATCH] 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. --- src/link.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/link.cpp b/src/link.cpp index d3bbfe9..162f958 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -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 ); }