Skip to content

Commit

Permalink
Protection against non-existing feeId in the MID RDH
Browse files Browse the repository at this point in the history
  • Loading branch information
dstocco authored and shahor02 committed Apr 21, 2022
1 parent 110b9a6 commit 59d224b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Detectors/MUON/MID/Raw/include/MIDRaw/Decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#endif
#include <vector>
#include <gsl/gsl>
#include "Framework/Logger.h"
#include "DataFormatsMID/ROFRecord.h"
#include "DetectorsRaw/RDHUtils.h"
#include "MIDRaw/CrateMasks.h"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 59d224b

Please sign in to comment.