/***************************************************************************
- * 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 *
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;