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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Wed Feb 22 09:42:01 GMT 2012


Author: whalley
Date: Wed Feb 22 09:42:01 2012
New Revision: 1513

Log:
fix to stop error when no y points

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	Tue Feb 14 10:37:14 2012	(r1512)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/PlainFormatter.java	Wed Feb 22 09:42:01 2012	(r1513)
@@ -186,8 +186,10 @@
             for (int ix=1; ix<x.getDataset().getXAxes().size(); ix++){s.append("x" + Integer.toString(ix+1) + "\t");} 
             for ( YAxis yax : d.getYAxes()){
                s.append("y\t");
-               for (int e = 0; e < yax.getPoints().first().getErrors().size(); ++e) {
-                   s.append("dy+\tdy-\t");
+               if(yax.getPoints().size()>0) {
+                   for (int e = 0; e < yax.getPoints().first().getErrors().size(); ++e) {
+                        s.append("dy+\tdy-\t");
+                   }
                }
             }   
             s.append("\n");


More information about the HepData-svn mailing list