From 19822d55f2a6708a2a995b58fcb9b04122469d7f Mon Sep 17 00:00:00 2001 From: colin Date: Tue, 11 Nov 2025 11:32:01 +0800 Subject: [PATCH] fix(notifications): Fix null references to notification types --- .../AbpNotificationsApplicationAutoMapperProfile.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationAutoMapperProfile.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationAutoMapperProfile.cs index df5b18e85..d3f0b8623 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationAutoMapperProfile.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationAutoMapperProfile.cs @@ -15,11 +15,14 @@ public class AbpNotificationsApplicationAutoMapperProfile : Profile if (src != null) { var dataType = Type.GetType(src.NotificationTypeName); - var data = Activator.CreateInstance(dataType); - if (data is NotificationData notificationData) + if (dataType != null) { - notificationData.ExtraProperties = src.ExtraProperties; - return notificationData; + var data = Activator.CreateInstance(dataType); + if (data is NotificationData notificationData) + { + notificationData.ExtraProperties = src.ExtraProperties; + return notificationData; + } } } return new NotificationData();