Guard null pointer

This commit is contained in:
Magne Sjaastad 2023-11-07 09:59:35 +01:00
parent 4da4a222ca
commit 3bf81b44d5

View File

@ -96,7 +96,8 @@ void RimReservoirCellResultsStorage::setupBeforeSave()
bool hasResultsToStore = false;
for ( size_t rIdx = 0; rIdx < resAddrs.size(); ++rIdx )
{
if ( m_cellResults->resultInfo( resAddrs[rIdx] )->needsToBeStored() )
auto resInfo = m_cellResults->resultInfo( resAddrs[rIdx] );
if ( resInfo && resInfo->needsToBeStored() )
{
hasResultsToStore = true;
break;