mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1768 Guard against access of null pointer
This commit is contained in:
parent
b4cbe9fdd2
commit
e4afb24421
@ -213,7 +213,6 @@ void RifEclipseUnifiedRestartFileAccess::readWellData(well_info_type* well_info,
|
||||
void RifEclipseUnifiedRestartFileAccess::setRestartFiles(const QStringList& fileSet)
|
||||
{
|
||||
m_filename = fileSet[0];
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -233,6 +232,8 @@ std::vector<int> RifEclipseUnifiedRestartFileAccess::reportNumbers()
|
||||
{
|
||||
std::vector<int> reportNr;
|
||||
|
||||
if (openFile())
|
||||
{
|
||||
// Taken from well_info_add_UNRST_wells
|
||||
|
||||
int num_blocks = ecl_file_get_num_named_kw(m_ecl_file, SEQNUM_KW);
|
||||
@ -250,6 +251,7 @@ std::vector<int> RifEclipseUnifiedRestartFileAccess::reportNumbers()
|
||||
} //
|
||||
ecl_file_pop_block(m_ecl_file); // <-------------------------------------------------------
|
||||
}
|
||||
}
|
||||
|
||||
return reportNr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user