Skip to content

Commit a682e3d

Browse files
authored
DPL: avoid crash on nullptr in proxy (#10077)
In principle I do not expect this to happen, but just in case.
1 parent 580f507 commit a682e3d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Framework/Core/src/ExternalFairMQDeviceProxy.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,11 @@ DataProcessorSpec specifyExternalFairMQDeviceProxy(char const* name,
479479
static auto countEoS = [](fair::mq::Parts& inputs) -> int {
480480
int count = 0;
481481
for (int msgidx = 0; msgidx < inputs.Size() / 2; ++msgidx) {
482+
// Skip when we have nullptr for the header.
483+
// Not sure it can actually happen, but does not hurt.
484+
if (inputs.At(msgidx * 2).get() == nullptr) {
485+
continue;
486+
}
482487
auto const sih = o2::header::get<SourceInfoHeader*>(inputs.At(msgidx * 2)->GetData());
483488
if (sih != nullptr && sih->state == InputChannelState::Completed) {
484489
count++;

0 commit comments

Comments
 (0)