diff --git a/services/ans/src/advanced_notification_live_view_service.cpp b/services/ans/src/advanced_notification_live_view_service.cpp index ed39e55e286c7be4708d947e6ca64a13ba7d0281..f85bfb1da707002b7c9aa44e200e81d83aee37b8 100644 --- a/services/ans/src/advanced_notification_live_view_service.cpp +++ b/services/ans/src/advanced_notification_live_view_service.cpp @@ -162,7 +162,8 @@ void AdvancedNotificationService::OnSubscriberAdd( sptr sortingMap = GenerateSortingMap(); std::vector> notifications; for (auto notificationRecord : notificationList_) { - if (notificationRecord->notification != nullptr && + if (notificationRecord != nullptr && + notificationRecord->notification != nullptr && notificationRecord->notification->GetNotificationRequest().IsCommonLiveView()) { notifications.emplace_back(notificationRecord->notification); }