coverity fix
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Jul 2013 16:10:05 +0000 (16:10 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Jul 2013 16:10:05 +0000 (16:10 +0000)
PWGPP/HMPID/AliHMPIDTaskQA.cxx

index da1d098..e696696 100644 (file)
@@ -239,8 +239,10 @@ void AliHMPIDTaskQA::UserExec(Option_t *)
   Int_t label = -1;
   if (fUseMC){
     AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
-    fMC = mcH->MCEvent();
-    pStack = fMC->Stack();
+    if (mcH) {
+      fMC = mcH->MCEvent();
+      pStack = fMC->Stack();
+    }  
   }
 
   //