Skip to content

Commit 1e04af4

Browse files
committed
attempt to fix crash at the 1st event
1 parent 079015d commit 1e04af4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

SimG4CMS/Calo/src/CaloSD.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,12 @@ void CaloSD::PrintAll() {
444444

445445
void CaloSD::fillHits(edm::PCaloHitContainer& cc, const std::string& hname) {
446446
for (int k = 0; k < nHC_; ++k) {
447+
if (nullptr == slave[k].get()) {
448+
continue;
449+
}
447450
#ifdef EDM_ML_DEBUG
448-
edm::LogVerbatim("CaloSim") << "CaloSD: Tries to transfer " << slave[k].get()->hits().size() << " hits for "
449-
<< slave[k].get()->name() << " " << hname;
451+
edm::LogVerbatim("CaloSim") << "CaloSD: " << k << ". Tries to transfer " << slave[k].get()->hits().size()
452+
<< " hits for " << slave[k].get()->name() << " " << hname;
450453
#endif
451454
if (slave[k].get()->name() == hname) {
452455
cc = slave[k].get()->hits();

0 commit comments

Comments
 (0)