Commit d7d2952e authored by Matija Obreza's avatar Matija Obreza

Fixed missing NPE check and println to stderr

parent 454a710a
......@@ -56,8 +56,13 @@ public class GeoRegionServiceImpl implements GeoRegionService {
@Override
public GeoRegion getRegion(Country country) {
// NPE check
country.getId();
GeoRegion geoRegion = geoRegionRepository.findByCountry(country);
geoRegion.getCountries().size();
if (geoRegion != null) {
geoRegion.getCountries().size();
}
return geoRegion;
}
......
......@@ -147,14 +147,14 @@ public class SelectionController extends BaseController {
final String[] splits = accessionIds.split("[,;\\t\\n]+");
for (final String s : splits) {
System.err.println(">> '" + s.trim() + "'");
// System.err.println(">> '" + s.trim() + "'");
try {
final Accession accession = genesysService.getAccession(instCode, s.trim());
if (accession != null) {
System.err.println("\t" + accession.getId());
// System.err.println("\t" + accession.getId());
selectionBean.add(accession.getId());
} else {
System.err.println("\t NF='" + s + "'");
// System.err.println("\t NF='" + s + "'");
}
} catch (NonUniqueAccessionException e) {
// Non-unique
......
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