]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/information/pixmapviewer.cpp
Merge branch 'KDE/4.14'
[dolphin.git] / src / panels / information / pixmapviewer.cpp
index afa4c2f282d655a41a37bfcde7e1ac8f138b8d44..45a8c17e222d1bb64f5d1a185b706c2554e02a24 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at>                  *
+ *   Copyright (C) 2006 by Peter Penz <peter.penz19@gmail.com>             *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -102,11 +102,13 @@ void PixmapViewer::paintEvent(QPaintEvent* event)
         const bool useOldPixmap = (m_transition == SizeTransition) &&
                                   (m_oldPixmap.width() > m_pixmap.width());
         const QPixmap& largePixmap = useOldPixmap ? m_oldPixmap : m_pixmap;
-        const QPixmap scaledPixmap = largePixmap.scaled(scaledWidth,
-                                                        scaledHeight,
-                                                        Qt::IgnoreAspectRatio,
-                                                        Qt::FastTransformation);
-        painter.drawPixmap(x, y, scaledPixmap);
+       if (!largePixmap.isNull()) {
+            const QPixmap scaledPixmap = largePixmap.scaled(scaledWidth,
+                                                            scaledHeight,
+                                                            Qt::IgnoreAspectRatio,
+                                                            Qt::FastTransformation);
+            painter.drawPixmap(x, y, scaledPixmap);
+       }
     } else {
         const int x = (width()  - m_pixmap.width() ) / 2;
         const int y = (height() - m_pixmap.height()) / 2;