mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Guard against accessing null pointer
This commit is contained in:
parent
706241db5c
commit
169944641f
@ -83,16 +83,23 @@ void RimEclipseResultDefinition::setEclipseCase(RimEclipseCase* eclipseCase)
|
||||
updateFieldVisibility();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList RimEclipseResultDefinition::getResultVariableListForCurrentUIFieldSettings()
|
||||
{
|
||||
if (!m_eclipseCase ) return QStringList();
|
||||
RimReservoirCellResultsStorage* cellResultsStorage = currentGridCellResults();
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_porosityModelUiField());
|
||||
if (!cellResultsStorage) return QStringList();
|
||||
|
||||
return m_eclipseCase->results(porosityModel)->cellResults()->resultNames(m_resultTypeUiField());
|
||||
if (!cellResultsStorage->cellResults()) return QStringList();
|
||||
|
||||
return cellResultsStorage->cellResults()->resultNames(m_resultTypeUiField());
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimReservoirCellResultsStorage* RimEclipseResultDefinition::currentGridCellResults() const
|
||||
{
|
||||
if (!m_eclipseCase ) return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user