From 92fb9ddcc2925a4260b585e091e5bbcdad4a11b6 Mon Sep 17 00:00:00 2001 From: Artyom_Yashin Date: Wed, 22 May 2024 16:28:47 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=B3=D0=B0=D0=B2=D0=B0=D0=B6?= =?UTF-8?q?=D0=BD=D0=BE!!!!!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ComputersShopDatabaseImplement/Models/MessageInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ComputersShop/ComputersShopDatabaseImplement/Models/MessageInfo.cs b/ComputersShop/ComputersShopDatabaseImplement/Models/MessageInfo.cs index b3d5341..d6bbf9f 100644 --- a/ComputersShop/ComputersShopDatabaseImplement/Models/MessageInfo.cs +++ b/ComputersShop/ComputersShopDatabaseImplement/Models/MessageInfo.cs @@ -44,7 +44,7 @@ namespace ComputersShopDatabaseImplement.Models { Body = model.Body, Subject = model.Subject, - ClientId = context.Clients.FirstOrDefault(x => x.Email == model.SenderName).Id, + ClientId = context.Clients.FirstOrDefault(x => x.Email == model.SenderName)?.Id, Client = context.Clients.FirstOrDefault(x => x.Email == model.SenderName), MessageId = model.MessageId, SenderName = model.SenderName,