don't crash when loadPNG fails
authorFelix Domke <tmbinc@elitedvb.net>
Mon, 27 Feb 2006 22:09:18 +0000 (22:09 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Mon, 27 Feb 2006 22:09:18 +0000 (22:09 +0000)
lib/gui/epixmap.cpp

index 31998c1..70ea9d6 100644 (file)
@@ -22,7 +22,13 @@ void ePixmap::setPixmap(gPixmap *pixmap)
 void ePixmap::setPixmapFromFile(const char *filename)
 {
        loadPNG(m_pixmap, filename);
 void ePixmap::setPixmapFromFile(const char *filename)
 {
        loadPNG(m_pixmap, filename);
-               
+       
+       if (!m_pixmap)
+       {
+               eDebug("ePixmap::setPixmapFromFile: loadPNG failed");
+               return;
+       }
+       
                // TODO
        getDesktop()->makeCompatiblePixmap(*m_pixmap);
        event(evtChangedPixmap);
                // TODO
        getDesktop()->makeCompatiblePixmap(*m_pixmap);
        event(evtChangedPixmap);