Commit in GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd on MAIN | |||
TPC.java | +4 | -1 | 1.6 -> 1.7 |
Fixed a null pointer exception for layers without the repeat attribute
diff -u -r1.6 -r1.7 --- TPC.java 20 Jul 2011 21:53:57 -0000 1.6 +++ TPC.java 19 Jan 2012 12:42:18 -0000 1.7 @@ -60,8 +60,11 @@
int n = 0; for (Iterator i = node.getChildren("layer").iterator(); i.hasNext();) {
+ int repeat = 1;
Element layer = (Element) i.next();
- int repeat = (int)layer.getAttribute("repeat").getDoubleValue();
+ if (layer.getAttribute("repeat") != null) { + repeat = (int) Math.round(layer.getAttribute("repeat").getDoubleValue()); + }
for (int ll=0; ll<repeat; ll++) { double rlayer = r;
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1