|
[HepData-svn] r1849 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/formatsblackhole at projects.hepforge.org blackhole at projects.hepforge.orgFri Mar 27 15:30:16 GMT 2015
Author: whalley Date: Fri Mar 27 15:30:16 2015 New Revision: 1849 Log: fix null pointer for ids array Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/JsonFormatter.java Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/JsonFormatter.java ============================================================================== --- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/JsonFormatter.java Fri Mar 27 15:08:14 2015 (r1848) +++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/JsonFormatter.java Fri Mar 27 15:30:16 2015 (r1849) @@ -29,7 +29,10 @@ String[] descs = { "description1" , "description2" , "description3" , "description4" }; String[] links = { "link1" , "link2" , "link3" , "link4" }; - String[] ids = { p.getSpiresId().toString() , p.getInspireId().toString() , p.getRedId().toString() }; + String[] ids = new String[3]; + if(p.getSpiresId() != null ) { ids[0]=p.getSpiresId().toString(); } else { ids[0]=""; } + if(p.getInspireId() != null ) { ids[1]=p.getInspireId().toString(); } else { ids[1]=""; } + if(p.getRedId() != null ) { ids[2]=p.getRedId().toString(); } else { ids[2]=""; } for (int i=0; i<descs.length-1; i++){ for(int j=0; j<ids.length-1; j++){
More information about the HepData-svn mailing list |