Fix coverity : CID 19655 - Forward Null
authoramaire <amaire@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Jan 2013 16:32:33 +0000 (16:32 +0000)
committeramaire <amaire@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Jan 2013 16:32:33 +0000 (16:32 +0000)
Check the AliESDtrack pointer is not null, in the method AliAnalysisTaskCheckCascade::DoAngularCorrelation.
If null, return the function.

       AliESDtrack *lLeadingTrck = 0x0;
              lLeadingTrck =dynamic_cast<AliESDtrack*>( (InputEvent())->GetTrack( lLeadingPrimTrackIdx ) );
       if( !lLeadingTrck ) return;

Cheers,
   Antonin

PWGLF/STRANGENESS/Cascades/AliAnalysisTaskCheckCascade.cxx

index dfea702..5667c29 100644 (file)
@@ -3111,7 +3111,9 @@ void AliAnalysisTaskCheckCascade::DoAngularCorrelation( const Char_t   *lCascTyp
         
         
                 // 2nd step: filling ONCE the THnSparse
-                AliESDtrack *lLeadingTrck = dynamic_cast<AliESDtrack*>( (InputEvent())->GetTrack( lLeadingPrimTrackIdx ) );
+                AliESDtrack *lLeadingTrck = 0x0;
+                    lLeadingTrck =dynamic_cast<AliESDtrack*>( (InputEvent())->GetTrack( lLeadingPrimTrackIdx ) );
+                if( !lLeadingTrck ) return;
                 
                 TVector3 lTVect3MomLeadingTrck( lLeadingTrck->Px(), lLeadingTrck->Py(), lLeadingTrck->Pz() );