From 3cb1a4f648c35fd581e8656db7977f01434aa605 Mon Sep 17 00:00:00 2001 From: dstocco Date: Tue, 19 Apr 2022 11:00:38 +0200 Subject: [PATCH] Protection against non-existing feeId in the MID RDH --- Detectors/MUON/MID/Raw/include/MIDRaw/Decoder.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Detectors/MUON/MID/Raw/include/MIDRaw/Decoder.h b/Detectors/MUON/MID/Raw/include/MIDRaw/Decoder.h index 3bae82bcc93d9..c50fe6d0d918b 100644 --- a/Detectors/MUON/MID/Raw/include/MIDRaw/Decoder.h +++ b/Detectors/MUON/MID/Raw/include/MIDRaw/Decoder.h @@ -22,6 +22,7 @@ #endif #include #include +#include "Framework/Logger.h" #include "DataFormatsMID/ROFRecord.h" #include "DetectorsRaw/RDHUtils.h" #include "MIDRaw/CrateMasks.h" @@ -51,7 +52,12 @@ class Decoder #if defined(MID_RAW_VECTORS) mLinkDecoders[feeId]->process(payload, o2::raw::RDHUtils::getHeartBeatOrbit(rdh), mData, mROFRecords); #else - mLinkDecoders.find(feeId)->second->process(payload, o2::raw::RDHUtils::getHeartBeatOrbit(rdh), mData, mROFRecords); + auto linkDecoder = mLinkDecoders.find(feeId); + if (linkDecoder != mLinkDecoders.end()) { + linkDecoder->second->process(payload, o2::raw::RDHUtils::getHeartBeatOrbit(rdh), mData, mROFRecords); + } else { + LOG(alarm) << "Unexpected feeId " << feeId << " in RDH"; + } #endif } /// Gets the vector of data