From 48cf053a3036fcb6342fb6c2241d60f801eacbaa Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Fri, 6 Sep 2024 18:28:25 +0200 Subject: [PATCH] Check also in case the FirstEventEntry is negative --- k4FWCore/components/IOSvc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/k4FWCore/components/IOSvc.cpp b/k4FWCore/components/IOSvc.cpp index 174d403c..c2c6869b 100644 --- a/k4FWCore/components/IOSvc.cpp +++ b/k4FWCore/components/IOSvc.cpp @@ -61,8 +61,8 @@ StatusCode IOSvc::initialize() { m_entries = m_reader->getEntries(podio::Category::Event); } - if (m_entries && m_firstEventEntry >= m_entries) { - error() << "First event entry is larger than the number of entries in the file" << endmsg; + if ((m_entries && m_firstEventEntry >= m_entries) || m_firstEventEntry < 0) { + error() << "First event entry is larger than the number of entries in the file or negative" << endmsg; return StatusCode::FAILURE; }