Commit 7464eb81 authored by Matija Obreza's avatar Matija Obreza
Browse files

Fixed NPE when { "storage": null } is provided

parent 9b1fc4fe
......@@ -467,6 +467,8 @@ public class BatchRESTServiceImpl implements BatchRESTService {
List<Integer> as = accession.getStoRage();
List<Integer> toRemove = new ArrayList<Integer>(as);
// Sometimes { "storage": null } is provided.
if (arr != null) {
Iterator<JsonNode> it = arr.elements();
while (it.hasNext()) {
......@@ -480,6 +482,7 @@ public class BatchRESTServiceImpl implements BatchRESTService {
toRemove.remove((Integer) stor);
}
}
}
if (toRemove.size() > 0) {
as.removeAll(toRemove);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment