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 4 months ago
committed by GitHub
parent
commit
1b67786ea3
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  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) if (src != null)
{ {
var dataType = Type.GetType(src.NotificationTypeName); var dataType = Type.GetType(src.NotificationTypeName);
if (dataType != null)
{
var data = Activator.CreateInstance(dataType); var data = Activator.CreateInstance(dataType);
if (data is NotificationData notificationData) if (data is NotificationData notificationData)
{ {
@ -22,6 +24,7 @@ public class AbpNotificationsApplicationAutoMapperProfile : Profile
return notificationData; return notificationData;
} }
} }
}
return new NotificationData(); return new NotificationData();
})); }));
} }

Loading…
Cancel
Save