Commit c56bf186 authored by Labros Papadopoulos's avatar Labros Papadopoulos
Browse files

check if related party isEmpty in externally added specifications

parent ece07a05
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ public class ServiceSpecificationRepoService {
		ServiceSpecificationRef serviceSpecificationRef = new ServiceSpecificationRef();
		serviceCandidate.setServiceSpecification(serviceSpecificationRef);
		serviceSpecificationRef.setId(serviceSpec.getId());
		if(serviceServiceSpecification.getRelatedParty().get(0).getRole().equalsIgnoreCase(UserPartRoleType.ORGANIZATION.getValue())){
		if(serviceServiceSpecification.getRelatedParty()!=null && !serviceServiceSpecification.getRelatedParty().isEmpty() && serviceServiceSpecification.getRelatedParty().get(0).getRole().equalsIgnoreCase(UserPartRoleType.ORGANIZATION.getValue())){
			Optional<ServiceCategory> serviceCategory =categoriesRepository.findByName(serviceServiceSpecification.getRelatedParty().get(0).getName());
			if (serviceCategory.isPresent()) serviceCandidate.setCategory(new ArrayList<>((Collection) serviceCategory.get()));
		}