Skip to content

Commit

Permalink
ensure null does not give address point
Browse files Browse the repository at this point in the history
  • Loading branch information
acn-sbuad committed Apr 24, 2024
1 parent 345aafd commit c407ee7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Altinn.Notifications.Core/Services/ContactPointService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ await AugmentRecipients(
recipients,
(recipient, userContactPoints) =>
{
recipient.AddressInfo.Add(new EmailAddressPoint(userContactPoints.Email));
if (!string.IsNullOrEmpty(userContactPoints.Email))
{
recipient.AddressInfo.Add(new EmailAddressPoint(userContactPoints.Email));
}

return recipient;
});
}
Expand All @@ -40,7 +44,11 @@ await AugmentRecipients(
recipients,
(recipient, userContactPoints) =>
{
recipient.AddressInfo.Add(new SmsAddressPoint(userContactPoints.MobileNumber));
if (!string.IsNullOrEmpty(userContactPoints.MobileNumber))
{
recipient.AddressInfo.Add(new SmsAddressPoint(userContactPoints.MobileNumber));
}

return recipient;
});
}
Expand Down

0 comments on commit c407ee7

Please sign in to comment.