]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONClusterFinderMLEM.cxx
Adding a protection before accessing the cluster list
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterFinderMLEM.cxx
index 6596734d2fdf9fa140729e5c963498029965a391..8efe3a0c4a77f16d0b4cf212a74ab6e312bad3b4 100644 (file)
@@ -156,7 +156,14 @@ AliMUONClusterFinderMLEM::NextCluster()
 //  AliCodeTimerAuto("",0)
   
   // if the list of clusters is not void, pick one from there
-  TObject* o = fClusterList.At(++fClusterNumber);
+  TObject* o(0x0);
+  
+  // do we have clusters in our list ?
+  if ( fClusterNumber < fClusterList.GetLast() )
+  {
+    o = fClusterList.At(++fClusterNumber);
+  }
+  
   if ( o != 0x0 ) return static_cast<AliMUONCluster*>(o);
   
   //FIXME : at this point, must check whether we've used all the digits