From 295c4cb1c71f8ae9940c0b27325c917cf83fa59b Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Fri, 14 Oct 2022 12:50:45 +0200 Subject: [PATCH] DPL: avoid crash on nullptr in proxy In principle I do not expect this to happen, but just in case. --- Framework/Core/src/ExternalFairMQDeviceProxy.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Framework/Core/src/ExternalFairMQDeviceProxy.cxx b/Framework/Core/src/ExternalFairMQDeviceProxy.cxx index 26fca3f1c6741..5797f6724e266 100644 --- a/Framework/Core/src/ExternalFairMQDeviceProxy.cxx +++ b/Framework/Core/src/ExternalFairMQDeviceProxy.cxx @@ -479,6 +479,11 @@ DataProcessorSpec specifyExternalFairMQDeviceProxy(char const* name, static auto countEoS = [](fair::mq::Parts& inputs) -> int { int count = 0; for (int msgidx = 0; msgidx < inputs.Size() / 2; ++msgidx) { + // Skip when we have nullptr for the header. + // Not sure it can actually happen, but does not hurt. + if (inputs.At(msgidx * 2).get() == nullptr) { + continue; + } auto const sih = o2::header::get(inputs.At(msgidx * 2)->GetData()); if (sih != nullptr && sih->state == InputChannelState::Completed) { count++;