Skip to content

Commit df09b1d

Browse files
committed
Avoid assert when accessing result values
1 parent f7c7208 commit df09b1d

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

ApplicationLibCode/FileInterface/RifReaderEnsembleStatisticsRft.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,14 @@ void RifReaderEnsembleStatisticsRft::values( const RifEclipseRftAddress& rftAddr
8686
{
8787
if ( !m_summaryCaseCollection ) return;
8888

89-
CAF_ASSERT( rftAddress.wellLogChannel() == RifEclipseRftAddress::RftWellLogChannelType::MD ||
90-
rftAddress.wellLogChannel() == RifEclipseRftAddress::RftWellLogChannelType::TVD ||
91-
rftAddress.wellLogChannel() == RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_MEAN ||
92-
rftAddress.wellLogChannel() == RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_P10 ||
93-
rftAddress.wellLogChannel() == RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_P50 ||
94-
rftAddress.wellLogChannel() == RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_P90 ||
95-
rftAddress.wellLogChannel() == RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_ERROR );
96-
9789
auto it = m_cachedValues.find( rftAddress );
9890
if ( it == m_cachedValues.end() )
9991
{
10092
calculateStatistics( rftAddress.wellName(), rftAddress.timeStep() );
10193
}
94+
95+
// The function calculateStatistics will store values in the value cache if the processing is successful. If the processing fails, the
96+
// assignment will create an entry in the cache with an empty vector
10297
*values = m_cachedValues[rftAddress];
10398
}
10499

0 commit comments

Comments
 (0)