]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
authormorsch <andreas.morsch@cern.ch>
Tue, 8 Jul 2014 21:26:12 +0000 (23:26 +0200)
committermorsch <andreas.morsch@cern.ch>
Tue, 8 Jul 2014 21:26:12 +0000 (23:26 +0200)
STEER/STEERBase/AliMCEvent.cxx

index 196fb70895991e3080ed20d52c69c2178ac3269d..44515d6a402d12db97c32f921e962f7f3113c15d 100644 (file)
@@ -977,6 +977,7 @@ void  AliMCEvent::SetParticleArray(TClonesArray* mcParticles)
       static Int_t binaryfirst(TClonesArray* a, Int_t low, Int_t high)
       {
        Int_t mid  = low + (high - low)/2;
+       if (low > a->GetEntries()-1) return (a->GetEntries()-1);
        if (!((AliVParticle*) a->At(mid))->IsPrimary()) {
          if (mid > 1 && !((AliVParticle*) a->At(mid-1))->IsPrimary()) {
            return binaryfirst(a, low, mid-1);