From ffcde7a2243a355c051876416067ce7725589d3f Mon Sep 17 00:00:00 2001 From: Ivan Razumov Date: Mon, 9 Dec 2024 11:17:42 +0100 Subject: [PATCH] SeedToTrackProducer: return early if L2 seed collection is not found --- SimMuon/MCTruth/plugins/SeedToTrackProducerBase.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SimMuon/MCTruth/plugins/SeedToTrackProducerBase.cc b/SimMuon/MCTruth/plugins/SeedToTrackProducerBase.cc index fb824635d83b0..8044b6f0040f2 100644 --- a/SimMuon/MCTruth/plugins/SeedToTrackProducerBase.cc +++ b/SimMuon/MCTruth/plugins/SeedToTrackProducerBase.cc @@ -65,8 +65,10 @@ void SeedToTrackProducerBase::produce(edm::StreamID, const std::vector *L2seeds = nullptr; if (L2seedsCollection.isValid()) L2seeds = L2seedsCollection.product(); - else + else { edm::LogError("SeedToTrackProducerBase") << "L2 seeds collection not found !! " << endl; + return; + } edm::Handle> seedHandle; iEvent.getByToken(L2seedsTagS_, seedHandle);