Skip to content
Snippets Groups Projects
Commit 4be0ba75 authored by Adam Laskowski's avatar Adam Laskowski
Browse files

SSDM-13524: Fixed create and update material executors

parent d53b75f2
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
......@@ -90,7 +90,7 @@ public class CreateMaterialTypesOperationExecutor
PropertyTypePE type =
findPropertyType(context,
propertyAssignmentCreation.getPropertyTypeId());
if (type.getType() != null && INVALID_TYPES.contains(type.getType().getCode()))
if (type != null && type.getType() != null && INVALID_TYPES.contains(type.getType().getCode()))
{
return false;
}
......@@ -106,11 +106,6 @@ public class CreateMaterialTypesOperationExecutor
Map<IPropertyTypeId, PropertyTypePE> propertyTypePEMap =
mapPropertyTypeByIdExecutor.map(context, Arrays.asList(propertyTypeId));
PropertyTypePE propertyTypePE = propertyTypePEMap.get(propertyTypeId);
if (propertyTypePE == null)
{
throw new ObjectNotFoundException(propertyTypeId);
}
return propertyTypePE;
}
......
......@@ -92,7 +92,7 @@ public class UpdateMaterialTypesOperationExecutor
{
PropertyTypePE type =
findPropertyType(context, addedAssignments.getPropertyTypeId());
if (type.getType() != null && INVALID_TYPES.contains(
if (type != null && type.getType() != null && INVALID_TYPES.contains(
type.getType().getCode()))
{
return false;
......@@ -106,7 +106,7 @@ public class UpdateMaterialTypesOperationExecutor
{
PropertyTypePE type =
findPropertyType(context, setAssignments.getPropertyTypeId());
if (type.getType() != null && INVALID_TYPES.contains(
if (type != null && type.getType() != null && INVALID_TYPES.contains(
type.getType().getCode()))
{
return false;
......@@ -124,11 +124,6 @@ public class UpdateMaterialTypesOperationExecutor
Map<IPropertyTypeId, PropertyTypePE> propertyTypePEMap =
mapPropertyTypeByIdExecutor.map(context, Arrays.asList(propertyTypeId));
PropertyTypePE propertyTypePE = propertyTypePEMap.get(propertyTypeId);
if (propertyTypePE == null)
{
throw new ObjectNotFoundException(propertyTypeId);
}
return propertyTypePE;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment