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 { ...@@ -467,6 +467,8 @@ public class BatchRESTServiceImpl implements BatchRESTService {
List<Integer> as = accession.getStoRage(); List<Integer> as = accession.getStoRage();
List<Integer> toRemove = new ArrayList<Integer>(as); List<Integer> toRemove = new ArrayList<Integer>(as);
// Sometimes { "storage": null } is provided.
if (arr != null) {
Iterator<JsonNode> it = arr.elements(); Iterator<JsonNode> it = arr.elements();
while (it.hasNext()) { while (it.hasNext()) {
...@@ -480,6 +482,7 @@ public class BatchRESTServiceImpl implements BatchRESTService { ...@@ -480,6 +482,7 @@ public class BatchRESTServiceImpl implements BatchRESTService {
toRemove.remove((Integer) stor); toRemove.remove((Integer) stor);
} }
} }
}
if (toRemove.size() > 0) { if (toRemove.size() > 0) {
as.removeAll(toRemove); 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