Print

Print


Commit in lcio/src/java/hep/lcio/util on MAIN
Printer.java+10-31.12 -> 1.13
add checks for null hits in TrackPrinter

lcio/src/java/hep/lcio/util
Printer.java 1.12 -> 1.13
diff -u -r1.12 -r1.13
--- Printer.java	3 Sep 2008 00:03:00 -0000	1.12
+++ Printer.java	20 May 2010 20:43:47 -0000	1.13
@@ -998,11 +998,18 @@
 				if (havehits)
 				{
 					ps.print(" hits ->");
-					List hits = trk.getTrackerHits() ; 
+					List hits = trk.getTrackerHits(); 
+					if (hits == null || hits.size() == 0) continue;
 					for(int j=0; j<hits.size(); j++)
 					{
-					  ps.format("[%08x] ", 
-							  Integer.valueOf(hits.get(j).hashCode())) ;
+					    // Guard against null hit.  For some reason, above checks for null
+					    // list and size of zero don't cover all cases where this may fail.
+					    try
+					    {					        					   
+					        ps.format("[%08x] ", Integer.valueOf(hits.get(j).hashCode())) ;
+					    }
+					    catch (NullPointerException x)
+					    {}					     
 					}
 					ps.println();
 				}
CVSspam 0.2.8