Commit d6eddca6 authored by Matija Obreza's avatar Matija Obreza
Browse files

Don’t return JSON for empty selection list

parent 59b2d25d
......@@ -107,14 +107,16 @@ public class SelectionController extends BaseController {
@ResponseBody
public List<AccessionGeoJson> selectionGeo() {
List<AccessionGeoJson> geo = new ArrayList<AccessionGeoJson>();
for (AccessionGeo acnGeo : genesysService.listAccessionsGeo(selectionBean.copy())) {
AccessionGeoJson g = new AccessionGeoJson();
g.id = acnGeo.getAccession().getId();
g.lat = acnGeo.getLatitude();
g.lng = acnGeo.getLongitude();
g.accessionName = acnGeo.getAccession().getAccessionName();
g.instCode = acnGeo.getAccession().getInstituteCode();
geo.add(g);
if (selectionBean.size() > 0) {
for (AccessionGeo acnGeo : genesysService.listAccessionsGeo(selectionBean.copy())) {
AccessionGeoJson g = new AccessionGeoJson();
g.id = acnGeo.getAccession().getId();
g.lat = acnGeo.getLatitude();
g.lng = acnGeo.getLongitude();
g.accessionName = acnGeo.getAccession().getAccessionName();
g.instCode = acnGeo.getAccession().getInstituteCode();
geo.add(g);
}
}
return geo;
}
......
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