Fix crash issue with empty blocks when removing block keywords from file deck

This commit is contained in:
Jon Jenssen authored and JJ committed 2026-03-13 11:41:20 +01:00
1 parent 188a52cd1e
commit f7154a8146
2 files changed
+5 -2

No files matched your search

@@ -1014,7 +1014,6 @@ int RifOpmFlowDeckFile::removeKeywords( const std::string& keywordName )
const auto& kw = m_fileDeck->operator[]( it ); const auto& kw = m_fileDeck->operator[]( it );
if ( kw.name() == keywordName ) 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 this is a block keyword, we need to skip all keywords until the corresponding end block
if ( blockKeywordNames.contains( keywordName ) ) if ( blockKeywordNames.contains( keywordName ) )
{ {
@@ -1031,6 +1030,10 @@ int RifOpmFlowDeckFile::removeKeywords( const std::string& keywordName )
it++; it++;
} }
} }
else
{
skipIndices.push_back( it );
}
} }
} }