-coverity fix
authorjbook <jbook@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 6 May 2013 11:32:51 +0000 (11:32 +0000)
committerjbook <jbook@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 6 May 2013 11:32:51 +0000 (11:32 +0000)
PWGDQ/dielectron/AliDielectronMC.cxx

index c2efcde..7536737 100644 (file)
@@ -1295,7 +1295,9 @@ Bool_t AliDielectronMC::GetPrimaryVertex(Double_t &primVtxX, Double_t &primVtxY,
      primVtxZ = mcVtx->GetZ();
      }else if(fAnaType == kAOD){
      AliAODEvent *aod=((AliAODInputHandler*)((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler()))->GetEvent();
+     if(!aod) return kFALSE;
      AliAODMCHeader *mcHead = dynamic_cast<AliAODMCHeader*>(aod->FindListObject(AliAODMCHeader::StdBranchName()));
+     if(!mcHead) return kFALSE; 
      primVtxX = mcHead->GetVtxX();
      primVtxY = mcHead->GetVtxY();
      primVtxZ = mcHead->GetVtxZ();