From 37c02a90a1c5e10f125eb2d02e747c6070c348dc Mon Sep 17 00:00:00 2001 From: iaom Date: Fri, 17 Mar 2023 17:18:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=9A=E7=9F=A5hint?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=9B=BE=E7=89=87=E6=97=B6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libukui-notification/popup-notification.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libukui-notification/popup-notification.cpp b/libukui-notification/popup-notification.cpp index 634bf40..5bf628f 100644 --- a/libukui-notification/popup-notification.cpp +++ b/libukui-notification/popup-notification.cpp @@ -285,12 +285,11 @@ void PopupNotification::setHints(const QVariantMap &hints) auto it = hints.find(QStringLiteral("image-data")); if (it != end) { d->m_image = d->parseImageHint(it->value()); - if (d->m_image.isNull()) { - return; - } - const QSize max = d->maximumImageSize(); - if (d->m_image.size().width() > max.width() || d->m_image.size().height() > max.height()) { - d->m_image = d->m_image.scaled(max, Qt::KeepAspectRatio, Qt::SmoothTransformation); + if (!d->m_image.isNull()) { + const QSize max = d->maximumImageSize(); + if (d->m_image.size().width() > max.width() || d->m_image.size().height() > max.height()) { + d->m_image = d->m_image.scaled(max, Qt::KeepAspectRatio, Qt::SmoothTransformation); + } } } if (d->m_image.isNull()) {