From f7154a81460f339f0cc03bb67ea55e304bf31d15 Mon Sep 17 00:00:00 2001 From: Jon Jenssen Date: Thu, 12 Mar 2026 18:02:19 +0100 Subject: [PATCH] Fix crash issue with empty blocks when removing block keywords from file deck --- ApplicationLibCode/FileInterface/RifOpmFlowDeckFile.cpp | 5 ++++- ThirdParty/custom-opm-common/opm-common | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/FileInterface/RifOpmFlowDeckFile.cpp b/ApplicationLibCode/FileInterface/RifOpmFlowDeckFile.cpp index 7cf3b4b769..8545e09ce2 100644 --- a/ApplicationLibCode/FileInterface/RifOpmFlowDeckFile.cpp +++ b/ApplicationLibCode/FileInterface/RifOpmFlowDeckFile.cpp @@ -1014,7 +1014,6 @@ int RifOpmFlowDeckFile::removeKeywords( const std::string& keywordName ) const auto& kw = m_fileDeck->operator[]( it ); if ( kw.name() == keywordName ) { - skipIndices.push_back( it ); // If this is a block keyword, we need to skip all keywords until the corresponding end block if ( blockKeywordNames.contains( keywordName ) ) { @@ -1031,6 +1030,10 @@ int RifOpmFlowDeckFile::removeKeywords( const std::string& keywordName ) it++; } } + else + { + skipIndices.push_back( it ); + } } } diff --git a/ThirdParty/custom-opm-common/opm-common b/ThirdParty/custom-opm-common/opm-common index 5a32e52fa5..78d59f54cb 160000 --- a/ThirdParty/custom-opm-common/opm-common +++ b/ThirdParty/custom-opm-common/opm-common @@ -1 +1 @@ -Subproject commit 5a32e52fa5ef7d173e33d7b5e8d8aa16a96f615e +Subproject commit 78d59f54cb65de24ce7b21c32d6bd65319e10b7d