coverity fix #24054 check if track pointer is null
authorgconesab <gustavo.conesa.balbastre@cern.ch>
Mon, 30 Jun 2014 16:41:10 +0000 (18:41 +0200)
committergconesab <gustavo.conesa.balbastre@cern.ch>
Mon, 30 Jun 2014 16:42:01 +0000 (18:42 +0200)
EMCAL/AliEMCALRecoUtils.cxx

index be45037..911724c 100644 (file)
@@ -2488,8 +2488,13 @@ void AliEMCALRecoUtils::SetTracksMatchedToCluster(const AliVEvent *event)
     for (Int_t iTrk=0; iTrk<nTracks; ++iTrk) 
     {
       AliVTrack* track = dynamic_cast<AliVTrack*>(event->GetTrack(iTrk));
-      if (iTrk == matchTrackIndex) continue;
-      if (track->GetEMCALcluster() == iClus) {
+      
+      if( !track ) continue;
+      
+      if ( iTrk == matchTrackIndex ) continue;
+      
+      if ( track->GetEMCALcluster() == iClus )
+      {
         arrayTrackMatched[nMatched] = iTrk;
         ++nMatched;
       }