From 52ab376f6e16b12ad22103637c1263de85772e30 Mon Sep 17 00:00:00 2001 From: baozeyu Date: Mon, 2 Sep 2024 15:38:41 +0800 Subject: [PATCH] =?UTF-8?q?littleIcon=E5=88=A4=E7=A9=BA=E5=A4=84=E7=90=86?= =?UTF-8?q?=20=EF=BC=88cherry=20picked=20commit=20from=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frameworks/ans/src/notification_request.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frameworks/ans/src/notification_request.cpp b/frameworks/ans/src/notification_request.cpp index 557b80cb6..775cd33aa 100644 --- a/frameworks/ans/src/notification_request.cpp +++ b/frameworks/ans/src/notification_request.cpp @@ -300,9 +300,11 @@ int64_t NotificationRequest::GetArchiveDeadLine() const void NotificationRequest::SetLittleIcon(const std::shared_ptr &littleIcon) { littleIcon_ = littleIcon; - Media::ImageInfo outImageInfo; - littleIcon->GetImageInfo(outImageInfo); - littleIconType_ = outImageInfo.encodedFormat; + if (littleIcon != nullptr) { + Media::ImageInfo outImageInfo; + littleIcon->GetImageInfo(outImageInfo); + littleIconType_ = outImageInfo.encodedFormat; + } } const std::shared_ptr NotificationRequest::GetLittleIcon() const -- Gitee