diff --git a/Marco.Pms.Services/Controllers/OrganizationController.cs b/Marco.Pms.Services/Controllers/OrganizationController.cs index b20a1d7..1001646 100644 --- a/Marco.Pms.Services/Controllers/OrganizationController.cs +++ b/Marco.Pms.Services/Controllers/OrganizationController.cs @@ -364,6 +364,11 @@ namespace Marco.Pms.Services.Controllers { continue; } + var isServiceExist = await _context.ServiceMasters.AnyAsync(s => s.Id == serviceId); + if (!isServiceExist) + { + continue; + } var projectService = projectServices.FirstOrDefault(ps => ps.ServiceId == serviceId); if (projectService == null) {