From 4818fa32f45912091c8e240000ef1f1bab0e89bc Mon Sep 17 00:00:00 2001 From: MahanCh Date: Tue, 1 Jul 2025 16:36:40 +0330 Subject: [PATCH] fix: throws null error on edit rollcall group --- .../CustomizeWorkshopSettingsApplication.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs b/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs index ed28d05e..55f2c182 100644 --- a/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs +++ b/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs @@ -342,7 +342,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo double salary = command.Salary.MoneyToDouble(); - var weeklyOffDays = command.OffDayOfWeeks.Select(x => new WeeklyOffDay(x)).ToList(); + var weeklyOffDays = command.OffDayOfWeeks?.Select(x => new WeeklyOffDay(x)).ToList()??[]; var entity = new CustomizeWorkshopGroupSettings(command.Name, salary, command.CustomizeWorkshopSettingId, shiftCollection, workshopSettings.FridayPay, workshopSettings.OverTimePay, workshopSettings.BaseYearsPay, workshopSettings.BonusesPay, workshopSettings.NightWorkPay, workshopSettings.MarriedAllowance, @@ -822,7 +822,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo var notSelectedEmployeeSettings = employeeSettings.Where(x => !selectedEmployeesIds.Contains(x.EmployeeId)); - var weeklyOffDays = command.OffDayOfWeeks.Select(x => new WeeklyOffDay(x)).ToList(); + var weeklyOffDays = command.OffDayOfWeeks?.Select(x => new WeeklyOffDay(x)).ToList() ?? []; using var transaction = new TransactionScope(); entity.EditSimpleAndOverwriteOnEmployee(command.Name, selectedEmployeesIds, groupSettingsShifts, command.WorkshopShiftStatus,