Guards against null summary reader

Prevents potential crash when accessing the summary reader, ensuring that `createAddressesIfRequired` is only called when the reader is valid.
This commit is contained in:
Magne Sjaastad committed 2025-08-16 15:20:44 +02:00
1 parent 1e3ff37e9a
commit fc85f3adee
1 file changed
+4 -1
@@ -129,7 +129,10 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fil
for ( RimSummaryCase* newSumCase : candidateCases )
{
newSumCase->summaryReader()->createAddressesIfRequired();
if ( auto reader = newSumCase->summaryReader() )
{
reader->createAddressesIfRequired();
}
RimSummaryEnsemble* existingCollection = nullptr;
auto existingSummaryCase = sumCaseColl->findTopLevelSummaryCaseFromFileName( newSumCase->summaryHeaderFilename() );