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; }