From 4a8dc1036c3138fcdeb8f436e1dd1994752d7fc4 Mon Sep 17 00:00:00 2001
From: P-A Loizeau <p.-a.loizeau@gsi.de>
Date: Mon, 22 Mar 2021 18:27:39 +0100
Subject: [PATCH] SegFault fix in CbmTofEventClusterizer: catch real data case
 with no match vector

---
 reco/detectors/tof/CbmTofEventClusterizer.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/reco/detectors/tof/CbmTofEventClusterizer.cxx b/reco/detectors/tof/CbmTofEventClusterizer.cxx
index f2ac5be4eb..b629186880 100644
--- a/reco/detectors/tof/CbmTofEventClusterizer.cxx
+++ b/reco/detectors/tof/CbmTofEventClusterizer.cxx
@@ -337,7 +337,7 @@ void CbmTofEventClusterizer::SetParContainers() {
 }
 
 void CbmTofEventClusterizer::Exec(Option_t* option) {
-  fTofDigiPointMatchesOut->clear();
+  if (nullptr != fTofDigiPointMatchesOut) fTofDigiPointMatchesOut->clear();
 
   if (fTofCalDigiVecOut) fTofCalDigiVecOut->clear();
   if (fEventsColl) {
-- 
GitLab