Coverity 10415 fixed
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Mar 2011 09:27:56 +0000 (09:27 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Mar 2011 09:27:56 +0000 (09:27 +0000)
STEER/AliAODHandler.cxx

index 6566402..f448cbd 100644 (file)
@@ -271,7 +271,11 @@ void AliAODHandler::StoreMCParticles(){
          TList* headerList = genCocktailHeader->GetHeaders();
          for(int i = headerList->GetEntries()-1;i>=0;--i){
              AliGenEventHeader *headerEntry = dynamic_cast<AliGenEventHeader*>(headerList->At(i));
-             SetMCHeaderInfo(mcHeader,headerEntry);
+         if (!headerEntry) {
+           AliFatal("AliGenEventHeader entry not found in the header list");
+         } else {   
+           SetMCHeaderInfo(mcHeader,headerEntry);
+         }  
          }
       }
       else{