]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG0/genLevelSimulation/AliAnalysisTaskdNdetaMC.cxx
Fix coverity 14232
[u/mrichter/AliRoot.git] / PWG0 / genLevelSimulation / AliAnalysisTaskdNdetaMC.cxx
index 9a3caa348c75299cef9a215590fde4287ab92658..238cf0dc0f49c4fc8d1b2da4fdc26db545c29ea0 100644 (file)
@@ -273,6 +273,10 @@ void AliAnalysisTaskdNdetaMC::UserExec(Option_t *)
   // also a AliEvent...
   //  AliVEvent* mcEvent = MCEvent();
   AliMCEvent* mcEvent = MCEvent();
+  if (!mcEvent) {
+     Printf("ERROR: Could not retrieve MC event");
+     return;
+  }
   AliGenPythiaEventHeader * headPy  = 0;
   AliGenDPMjetEventHeader * headPho = 0;
   AliGenEventHeader * htmp = mcEvent->GenEventHeader();
@@ -289,10 +293,6 @@ void AliAnalysisTaskdNdetaMC::UserExec(Option_t *)
     
   }
 
-  if (!mcEvent) {
-     Printf("ERROR: Could not retrieve MC event");
-     return;
-  }
 
   //  Printf("MC particles: %d", mcEvent->GetNumberOfTracks());
   //  Check if the evend is single diffractive