From 87500cef1b9b7057b76c3254e0c3ae15d095635c Mon Sep 17 00:00:00 2001 From: mfloris Date: Fri, 28 Jan 2011 09:38:50 +0000 Subject: [PATCH] Fix coverity 14232 --- PWG0/genLevelSimulation/AliAnalysisTaskdNdetaMC.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWG0/genLevelSimulation/AliAnalysisTaskdNdetaMC.cxx b/PWG0/genLevelSimulation/AliAnalysisTaskdNdetaMC.cxx index 9a3caa348c7..238cf0dc0f4 100644 --- a/PWG0/genLevelSimulation/AliAnalysisTaskdNdetaMC.cxx +++ b/PWG0/genLevelSimulation/AliAnalysisTaskdNdetaMC.cxx @@ -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 -- 2.43.0