]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adding protection for NULL pointer result of dynamic_cast
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Jan 2011 22:25:22 +0000 (22:25 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Jan 2011 22:25:22 +0000 (22:25 +0000)
HLT/trigger/AliHLTD0Trigger.cxx

index ad1f482071d9d627d5c4ec4ec8646cf658f514fc..99228897ff24a12a0fa79b95e7f6d3b507a18a3b 100644 (file)
@@ -505,6 +505,11 @@ Int_t AliHLTD0Trigger::RecV0(const TObject* iter){
   Double_t pvpos[3];
   
   AliESDEvent *event = dynamic_cast<AliESDEvent*>(const_cast<TObject*>( iter ) );
+  if (!event) {
+    HLTError("input object is not of type AliESDEvent");
+    return 0;
+  }
+
   event->GetStdContent();
   Int_t nV0 = event->GetNumberOfV0s();
   Double_t field = event->GetMagneticField();