From 132a719ad6d510d9e93cb3821ad76d0eb0bab1f9 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Fri, 8 Jan 2021 14:41:02 -0600 Subject: [PATCH] Avoid seg fault in HTXSRivetProducer If used in a job which processes no events, HTXSRivetProducer no longer seg faults. --- .../RivetInterface/plugins/HTXSRivetProducer.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GeneratorInterface/RivetInterface/plugins/HTXSRivetProducer.cc b/GeneratorInterface/RivetInterface/plugins/HTXSRivetProducer.cc index 564a710855c8c..89a7bcc3558f4 100644 --- a/GeneratorInterface/RivetInterface/plugins/HTXSRivetProducer.cc +++ b/GeneratorInterface/RivetInterface/plugins/HTXSRivetProducer.cc @@ -163,7 +163,10 @@ void HTXSRivetProducer::produce(edm::Event& iEvent, const edm::EventSetup&) { } } -void HTXSRivetProducer::endRun(edm::Run const& iRun, edm::EventSetup const& es) { _HTXS->printClassificationSummary(); } +void HTXSRivetProducer::endRun(edm::Run const& iRun, edm::EventSetup const& es) { + if (_HTXS) + _HTXS->printClassificationSummary(); +} void HTXSRivetProducer::beginRun(edm::Run const& iRun, edm::EventSetup const& es) { if (_prodMode == "AUTO") {