From ad4eb315c16f1dafd1ed881300fccafbf792c5b1 Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Sun, 15 Sep 2024 10:30:07 -0400 Subject: [PATCH] Fix failing test case --- src/libraries/JANA/JService.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/libraries/JANA/JService.cc b/src/libraries/JANA/JService.cc index 0a6327fd9..60635b262 100644 --- a/src/libraries/JANA/JService.cc +++ b/src/libraries/JANA/JService.cc @@ -9,17 +9,19 @@ void JService::DoInit(JServiceLocator* sl) { std::lock_guard lock(m_mutex); if (this->m_status != Status::Uninitialized) return; - auto params = m_app->GetJParameterManager(); - m_logger = params->GetLogger(GetLoggerName()); + if (m_app != nullptr) { - for (auto* parameter : m_parameters) { - parameter->Configure(*params, m_prefix); - } + auto params = m_app->GetJParameterManager(); + m_logger = params->GetLogger(GetLoggerName()); - for (auto* service : m_services) { - service->Fetch(m_app); - } + for (auto* parameter : m_parameters) { + parameter->Configure(*params, m_prefix); + } + for (auto* service : m_services) { + service->Fetch(m_app); + } + } CallWithJExceptionWrapper("JService::acquire_services", [&](){ this->acquire_services(sl); }); CallWithJExceptionWrapper("JService::Init", [&](){ this->Init(); });