Skip to content

Commit d85cd15

Browse files
committed
Fixing lookup.
1 parent ca0b9a7 commit d85cd15

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

eFormAPI/Plugins/Workflow.Pn/Workflow.Pn/Services/WorkflowCasesService/WorkflowCasesService.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,11 +904,14 @@ private async Task SendFileAsync(
904904
public async Task GenerateReportAndSendEmail(int languageId, string userName, WorkflowCase workflowCase, string solvedBy)
905905
{
906906
var emailRecipients = new List<string>();
907-
var emailRecipient = await _baseDbContext.EmailRecipients.SingleOrDefaultAsync(x => x.Name.ToLower().Replace(" ", "").Trim() ==
907+
var emailRecipient = await _baseDbContext.EmailRecipients.FirstOrDefaultAsync(x => x.Name.ToLower().Replace(" ", "").Trim() ==
908908
userName
909909
.Replace("Mobil", "")
910910
.Replace("Tablet", "").ToLower().Replace(" ", "").Trim());
911-
emailRecipients.Add(emailRecipient.Email);
911+
if (emailRecipient != null)
912+
{
913+
emailRecipients.Add(emailRecipient.Email);
914+
}
912915
var solvedByemailRecipient = await _baseDbContext.EmailRecipients.SingleOrDefaultAsync(x => x.Name.ToLower().Replace(" ", "").Trim() == solvedBy.ToLower().Replace(" ", "").Trim());
913916
if (solvedByemailRecipient != null)
914917
{

0 commit comments

Comments
 (0)