]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Protection added
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Apr 2013 20:59:46 +0000 (20:59 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Apr 2013 20:59:46 +0000 (20:59 +0000)
PYTHIA6/AliGenPythia.cxx

index 14f501bc6506c276b71d5e2841ecace49203cc87..c096ecf316c6cbe02d7bf24e6fd909b1736d8577 100644 (file)
@@ -948,9 +948,10 @@ Int_t  AliGenPythia::GenerateMB()
     Int_t* pParent = new Int_t[np];
     for (i=0; i< np; i++) pParent[i] = -1;
      if (fProcess == kPyJets || fProcess == kPyDirectGamma || fProcess == kPyBeautyJets || fProcess == kPyBeautyppMNRwmi) {
-       TParticle* jet1 = (TParticle *) fParticles.At(6);
+       TParticle* jet1 = (TParticle *) fParticles.At(6);
        TParticle* jet2 = (TParticle *) fParticles.At(7);
-       if (!CheckTrigger(jet1, jet2)) {
+       
+       if (!jet1 || ! jet2 || !CheckTrigger(jet1, jet2)) {
          delete [] pParent;
          return 0;
        }