From 5e7c3dd1f1a2c4f2f2e378628dde10ce28ca34d8 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 10 Nov 2025 13:08:29 +0100 Subject: [PATCH] #13095 Avoid error message trying to read data not present in file --- ApplicationLibCode/FileInterface/RifReaderOpmCommon.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ApplicationLibCode/FileInterface/RifReaderOpmCommon.cpp b/ApplicationLibCode/FileInterface/RifReaderOpmCommon.cpp index e75200e1ad..04b48fdfef 100644 --- a/ApplicationLibCode/FileInterface/RifReaderOpmCommon.cpp +++ b/ApplicationLibCode/FileInterface/RifReaderOpmCommon.cpp @@ -642,6 +642,9 @@ bool RifReaderOpmCommon::dynamicResult( const QString& result, { for ( auto& gridName : m_gridNames ) { + // Do not try to read data that is not present in the file + if ( !m_restartFile->hasArray( resultName, stepNumber ) ) continue; + if ( gridName == "global" ) // main grid, need to use separate method due to inner workings in opm_common { if ( kwType == EclIO::eclArrType::DOUB )