diff --git a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/UpdateMaterialTypesOperationExecutor.java b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/UpdateMaterialTypesOperationExecutor.java index d245d052a67b15e498974cddef2e2f58d6b4152b..064cd81ab01b1a116f470575b021cba62bb4f9ab 100644 --- a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/UpdateMaterialTypesOperationExecutor.java +++ b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/UpdateMaterialTypesOperationExecutor.java @@ -47,7 +47,8 @@ public class UpdateMaterialTypesOperationExecutor implements IUpdateMaterialTypesOperationExecutor { private static final List<DataTypeCode> INVALID_TYPES = - Arrays.asList(DataTypeCode.ARRAY_INTEGER, DataTypeCode.ARRAY_STRING, DataTypeCode.ARRAY_REAL, + Arrays.asList(DataTypeCode.ARRAY_INTEGER, DataTypeCode.ARRAY_STRING, + DataTypeCode.ARRAY_REAL, DataTypeCode.ARRAY_TIMESTAMP, DataTypeCode.JSON); @Autowired @@ -82,26 +83,34 @@ public class UpdateMaterialTypesOperationExecutor { for (MaterialTypeUpdate materialTypeUpdate : materialTypeUpdates) { - if(materialTypeUpdate.getPropertyAssignments() != null) + if (materialTypeUpdate.getPropertyAssignments() != null) { for (PropertyAssignmentCreation addedAssignments : materialTypeUpdate.getPropertyAssignments() .getAdded()) { - PropertyTypePE type = - findPropertyType(context, addedAssignments.getPropertyTypeId()); - if (type.getType() != null && INVALID_TYPES.contains(type.getType().getCode())) + if (addedAssignments.getPropertyTypeId() != null) { - return false; + PropertyTypePE type = + findPropertyType(context, addedAssignments.getPropertyTypeId()); + if (type.getType() != null && INVALID_TYPES.contains( + type.getType().getCode())) + { + return false; + } } } for (PropertyAssignmentCreation setAssignments : materialTypeUpdate.getPropertyAssignments() .getSet()) { - PropertyTypePE type = - findPropertyType(context, setAssignments.getPropertyTypeId()); - if (type.getType() != null && INVALID_TYPES.contains(type.getType().getCode())) + if (setAssignments.getPropertyTypeId() != null) { - return false; + PropertyTypePE type = + findPropertyType(context, setAssignments.getPropertyTypeId()); + if (type.getType() != null && INVALID_TYPES.contains( + type.getType().getCode())) + { + return false; + } } } }