don't crash when no left/right border pixmap defined
authorFelix Domke <tmbinc@elitedvb.net>
Sun, 21 May 2006 19:36:21 +0000 (19:36 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sun, 21 May 2006 19:36:21 +0000 (19:36 +0000)
lib/gui/ewindowstyleskinned.cpp

index b0ccba8..03c3fb7 100644 (file)
@@ -241,8 +241,15 @@ void eWindowStyleSkinned::setPixmap(int bs, int bp, gPixmap &pixmap)
                        if (m_border[bs].m_border_bottom < m_border[bs].m_pixmap[i]->size().height())
                                m_border[bs].m_border_bottom = m_border[bs].m_pixmap[i]->size().height();
 
-       m_border[bs].m_border_left = m_border[bs].m_pixmap[3]->size().width();
-       m_border[bs].m_border_right = m_border[bs].m_pixmap[5]->size().width();
+       if (m_border[bs].m_pixmap[3])
+               m_border[bs].m_border_left = m_border[bs].m_pixmap[3]->size().width();
+       else
+               m_border[bs].m_border_left = 0;
+       
+       if (m_border[bs].m_pixmap[5])
+               m_border[bs].m_border_right = m_border[bs].m_pixmap[5]->size().width();
+       else
+               m_border[bs].m_border_right = 0;
 
        eDebug("recalced border size for %d: %d:%d %d:%d",
                bs,