From 3fd909f8be2cbdc4866565a13631d4839ef6fc88 Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Tue, 7 May 2024 22:26:32 -0400 Subject: [PATCH] Small bugfix: JMultifactory app pointer --- src/libraries/JANA/JMultifactory.h | 2 -- src/libraries/JANA/Omni/JComponentFwd.h | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libraries/JANA/JMultifactory.h b/src/libraries/JANA/JMultifactory.h index a5de848e5..a635c535f 100644 --- a/src/libraries/JANA/JMultifactory.h +++ b/src/libraries/JANA/JMultifactory.h @@ -239,14 +239,12 @@ void JMultifactory::SetCollection(std::string tag, std::unique_ptr void JMultifactoryHelper::Process(const std::shared_ptr &event) { - mMultiFactory->SetApplication(this->GetApplication()); mMultiFactory->Execute(event); } #ifdef JANA2_HAVE_PODIO template void JMultifactoryHelperPodio::Process(const std::shared_ptr &event) { - mMultiFactory->SetApplication(this->GetApplication()); mMultiFactory->Execute(event); } #endif // JANA2_HAVE_PODIO diff --git a/src/libraries/JANA/Omni/JComponentFwd.h b/src/libraries/JANA/Omni/JComponentFwd.h index 0d1975916..f73bfe8f9 100644 --- a/src/libraries/JANA/Omni/JComponentFwd.h +++ b/src/libraries/JANA/Omni/JComponentFwd.h @@ -85,7 +85,12 @@ struct JComponent { return m_status; } - void SetApplication(JApplication* app) { m_app = app; } + void SetApplication(JApplication* app) { + if (app == nullptr) { + throw JException("Attempting to set a null JApplication pointer!"); + } + m_app = app; + } void SetLogger(JLogger logger) { m_logger = logger; }