coverity #24442, add check on nullness of primary particles pointer
authorgconesab <gustavo.conesa.balbastre@cern.ch>
Mon, 4 Aug 2014 09:37:45 +0000 (11:37 +0200)
committergconesab <gustavo.conesa.balbastre@cern.ch>
Mon, 4 Aug 2014 09:42:44 +0000 (11:42 +0200)
PWGGA/CaloTrackCorrelations/AliAnaPi0.cxx

index 74bbe54..30ed6aa 100755 (executable)
@@ -1290,6 +1290,11 @@ void AliAnaPi0::FillAcceptanceHistograms()
     if(GetReader()->ReadStack())
     {
       primStack = stack->Particle(i) ;
+      if(!primStack)
+      {
+        printf("AliAnaPi0::FillAcceptanceHistograms() - ESD primaries pointer not available!!\n");
+        continue;
+      }
       
       // If too small  skip
       if( primStack->Energy() < 0.4 ) continue;
@@ -1311,6 +1316,11 @@ void AliAnaPi0::FillAcceptanceHistograms()
     else
     {
       primAOD = (AliAODMCParticle *) mcparticles->At(i);
+      if(!primAOD)
+      {
+        printf("AliAnaPi0::FillAcceptanceHistograms() - AOD primaries pointer not available!!\n");
+        continue;
+      }
       
       // If too small  skip
       if( primAOD->E() < 0.4 ) continue;