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,