Browse Source

fix(notifications): Fix null references to notification types

pull/1381/head
colin 4 months ago
parent
commit
19822d55f2
  1. 3
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationAutoMapperProfile.cs

3
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationAutoMapperProfile.cs

@ -15,6 +15,8 @@ public class AbpNotificationsApplicationAutoMapperProfile : Profile
if (src != null)
{
var dataType = Type.GetType(src.NotificationTypeName);
if (dataType != null)
{
var data = Activator.CreateInstance(dataType);
if (data is NotificationData notificationData)
{
@ -22,6 +24,7 @@ public class AbpNotificationsApplicationAutoMapperProfile : Profile
return notificationData;
}
}
}
return new NotificationData();
}));
}

Loading…
Cancel
Save