fix against NULL pointer (Sergey Gorbunov)
authorjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 3 Nov 2010 15:27:07 +0000 (15:27 +0000)
committerjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 3 Nov 2010 15:27:07 +0000 (15:27 +0000)
PWG0/dNdPt/AlidNdPtAnalysisPbPb.cxx

index acdc0b8..d9bee18 100644 (file)
@@ -1153,7 +1153,8 @@ Long64_t AlidNdPtAnalysisPbPb::Merge(TCollection* const list)
 
     // physics selection
     //printf("entry->GetPhysicsTriggerSelection() %p \n", entry->GetPhysicsTriggerSelection());
-    collPhysSelection->Add(entry->GetPhysicsTriggerSelection());
+    AliPhysicsSelection *physSel = entry->GetPhysicsTriggerSelection();
+    if( physSel ) collPhysSelection->Add(physSel); 
     
     //
     fTrackPtCorrelationMatrix->Add(entry->fTrackPtCorrelationMatrix);
@@ -1209,7 +1210,7 @@ Long64_t AlidNdPtAnalysisPbPb::Merge(TCollection* const list)
   }
 
   AliPhysicsSelection *trigSelection = GetPhysicsTriggerSelection();
-  trigSelection->Merge(collPhysSelection);
+  if( trigSelection ) trigSelection->Merge(collPhysSelection);
   if(collPhysSelection) delete collPhysSelection;
 
 return count;