Browse Source

Merge pull request #1381 from colinin/fix-null-references-to-notification-type

fix(notifications): Fix null references to notification types
pull/1382/head
yx lin 3 months ago
committed by GitHub
parent
commit
1b67786ea3
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 11
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationAutoMapperProfile.cs

11
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();

Loading…
Cancel
Save