1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

QzTools: Return empty url when pixmap is null in pixmapToDataUrl

This commit is contained in:
David Rosca 2016-01-24 15:47:28 +01:00
parent 18926fd85b
commit e4abb59d3a

View File

@ -77,7 +77,8 @@ QPixmap QzTools::pixmapFromByteArray(const QByteArray &data)
QUrl QzTools::pixmapToDataUrl(const QPixmap &pix)
{
return QUrl(QSL("data:image/png;base64,") + QString(pixmapToByteArray(pix)));
const QString data(pixmapToByteArray(pix));
return data.isEmpty() ? QUrl() : QUrl(QSL("data:image/png;base64,") + data);
}
QString QzTools::readAllFileContents(const QString &filename)