lcsim/src/org/lcsim/contrib/uiowa
diff -u -r1.2 -r1.3
--- CheckSkeletonsForMultipleTracks.java 21 Sep 2007 01:01:18 -0000 1.2
+++ CheckSkeletonsForMultipleTracks.java 13 Oct 2007 20:10:04 -0000 1.3
@@ -330,8 +330,12 @@
for (Track tr : tracks) {
if (tr == null) { throw new AssertionError("Null track!"); }
Cluster matchedCluster = extrap.matchTrackToCluster(tr, clusters);
- if (mapClustersToTracks.get(matchedCluster) == null) { mapClustersToTracks.put(matchedCluster, new Vector<Track>()); }
- mapClustersToTracks.get(matchedCluster).add(tr);
+ // Cluster can be null if track isn't matched to anything.
+ // This shouldn't happen often, but can.
+ if (matchedCluster != null) {
+ if (mapClustersToTracks.get(matchedCluster) == null) { mapClustersToTracks.put(matchedCluster, new Vector<Track>()); }
+ mapClustersToTracks.get(matchedCluster).add(tr);
+ }
}
for (Cluster clus : mapClustersToTracks.keySet()) {
if (clus == null) { throw new AssertionError("Null cluster!"); }