Check for valid pointer before accessing cell result data

p4#: 21359
This commit is contained in:
Magne Sjaastad
2013-04-22 13:25:32 +02:00
parent ea45e6f072
commit d825b0654c
2 changed files with 9 additions and 7 deletions

View File

@@ -272,7 +272,7 @@ void RimReservoirView::updateViewerWidgetWindowTitle()
void RimReservoirView::clampCurrentTimestep()
{
// Clamp the current timestep to actual possibilities
if (this->currentGridCellResults()->cellResults())
if (this->currentGridCellResults() && this->currentGridCellResults()->cellResults())
{
if (m_currentTimeStep() >= static_cast<int>(this->currentGridCellResults()->cellResults()->maxTimeStepCount()))
{