mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-31 17:17:50 -05:00
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:
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() );
|
||||
|
||||
Reference in new issue
Block a user