[HepData-svn] r1541 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Wed May 30 14:35:59 BST 2012


Author: whalley
Date: Wed May 30 14:35:59 2012
New Revision: 1541

Log:
in plain text check if the x axis exists

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/PlainFormatter.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/PlainFormatter.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/PlainFormatter.java	Fri May  4 15:38:53 2012	(r1540)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/PlainFormatter.java	Wed May 30 14:35:59 2012	(r1541)
@@ -219,9 +219,11 @@
                     row.setAttribute("xlow", xlow);
                     row.setAttribute("xhigh", xhigh);
                     for (int ix=1; ix<x.getDataset().getXAxes().size(); ix++){
-                        row.setAttribute("val" + Integer.toString(ix),x.getDataset().getXAxis(ix+1).getBin(r).getFocus());
+                      if(x.getDataset().getXAxis(ix+1).getBin(r) != null){
+                        row.setAttribute("val" + Integer.toString(ix),x.getDataset().getXAxis(ix+1).getBin(r).getFocus()); 
                         row.setAttribute("val" + Integer.toString(ix)+"low",x.getDataset().getXAxis(ix+1).getBin(r).getLowValue());
                         row.setAttribute("val" + Integer.toString(ix)+"high",x.getDataset().getXAxis(ix+1).getBin(r).getHighValue());
+                      }
                     } 
                     s.append(row.toString());
                     for (int ny=1; ny<=p.getYAxis().getDataset().getYAxes().size(); ny++ ) {


More information about the HepData-svn mailing list