Skip to content
Snippets Groups Projects
Commit 3770dd35 authored by tpylak's avatar tpylak
Browse files

LMS-2648 remove the property when it's set to null

SVN: 23717
parent 261aabff
No related branches found
No related tags found
No related merge requests found
......@@ -141,14 +141,20 @@ public class DataSetRegistrationDetails<T extends DataSetInformation> implements
public void setPropertyValue(String propertyCode, String propertyValue)
{
ExtractableData datasetExtractableData = dataSetInformation.getExtractableData();
List<NewProperty> properties = datasetExtractableData.getDataSetProperties();
NewProperty property = EntityHelper.tryFindProperty(properties, propertyCode);
if (property != null)
if (propertyValue == null)
{
property.setValue(propertyValue);
datasetExtractableData.removeDataSetProperty(propertyCode);
} else
{
properties.add(new NewProperty(propertyCode, propertyValue));
List<NewProperty> properties = datasetExtractableData.getDataSetProperties();
NewProperty property = EntityHelper.tryFindProperty(properties, propertyCode);
if (property != null)
{
property.setValue(propertyValue);
} else
{
properties.add(new NewProperty(propertyCode, propertyValue));
}
}
}
......
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