Skip to content

Commit a8a3e38

Browse files
committed
add protection against empty ROF container
1 parent 438a57a commit a8a3e38

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Detectors/ITSMFT/common/workflow/src/DigitReaderSpec.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ void DigitReader<N>::run(ProcessingContext& pc)
189189
std::vector<int> rofOld2New;
190190
rofOld2New.resize(mDigROFRec[0]->size(), -1);
191191

192-
if (mDigROFRec[0]->front().getBCData() <= irMax && (mDigROFRec[0]->back().getBCData() + mROFLengthInBC - 1) >= irMin) { // there is an overlap
192+
if (!mDigROFRec[0]->empty() && mDigROFRec[0]->front().getBCData() <= irMax && (mDigROFRec[0]->back().getBCData() + mROFLengthInBC - 1) >= irMin) { // there is an overlap
193193
for (int irof = 0; irof < (int)mDigROFRec[0]->size(); irof++) {
194194
const auto& rof = mDigROFRec[0]->at(irof);
195195
if (irfSel.check({rof.getBCData(), rof.getBCData() + mROFLengthInBC - 1}) != -1) {
@@ -208,7 +208,7 @@ void DigitReader<N>::run(ProcessingContext& pc)
208208
}
209209
}
210210
}
211-
if (mDigROFRec[0]->back().getBCData() + mROFLengthInBC - 1 < irMax) { // need to check the next entry
211+
if (mDigROFRec[0]->empty() || mDigROFRec[0]->back().getBCData() + mROFLengthInBC - 1 < irMax) { // need to check the next entry
212212
ent++;
213213
continue;
214214
}

0 commit comments

Comments
 (0)