Skip to content
Snippets Groups Projects
Commit dce27e84 authored by juanf's avatar juanf
Browse files

SP-996 / BIS-517 : Reporting API BugFix: It was not possible to assign a null...

SP-996 / BIS-517 : Reporting API BugFix: It was not possible to assign a null experiment to delete the sample experiment from the API.

SVN: 30137
parent 4fbc072f
No related branches found
No related tags found
No related merge requests found
...@@ -45,9 +45,7 @@ public class Sample extends SampleImmutable implements ISample ...@@ -45,9 +45,7 @@ public class Sample extends SampleImmutable implements ISample
private final SampleBatchUpdateDetails updateDetails; private final SampleBatchUpdateDetails updateDetails;
/** /**
* This code is derived from * This code is derived from {@link ch.systemsx.cisd.openbis.generic.shared.basic.dto.builders.SampleBuilder}, which is in a test source folder.
* {@link ch.systemsx.cisd.openbis.generic.shared.basic.dto.builders.SampleBuilder}, which is in
* a test source folder.
*/ */
private static ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample buildSampleWithIdentifier( private static ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample buildSampleWithIdentifier(
String identifier) String identifier)
...@@ -114,7 +112,15 @@ public class Sample extends SampleImmutable implements ISample ...@@ -114,7 +112,15 @@ public class Sample extends SampleImmutable implements ISample
public void setExperiment(IExperimentImmutable experiment) public void setExperiment(IExperimentImmutable experiment)
{ {
ExperimentImmutable exp = (ExperimentImmutable) experiment; ExperimentImmutable exp = (ExperimentImmutable) experiment;
getSample().setExperiment(exp.getExperiment());
if (exp == null)
{
getSample().setExperiment(null);
} else
{
getSample().setExperiment(exp.getExperiment());
}
updateDetails.setExperimentUpdateRequested(true); updateDetails.setExperimentUpdateRequested(true);
} }
......
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