From a285ae8f610922520a50a8ae67edbde118cfdc51 Mon Sep 17 00:00:00 2001 From: sigurdp Date: Tue, 5 Dec 2017 16:16:58 +0100 Subject: [PATCH] PVT Plot: Added guarding to prevent access visolations when querying dynamic properties for PVT plots in cases where initialization of PVT curve collection fails. --- .../RigFlowDiagSolverInterface.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp index aa27e8bce7..8d5fa86453 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp @@ -733,6 +733,12 @@ bool RigFlowDiagSolverInterface::calculatePvtDynamicPropertiesFvf(size_t activeC return false; } + CVF_ASSERT(m_opmFlowDiagStaticData.notNull()); + if (!m_opmFlowDiagStaticData->m_eclPvtCurveCollection) + { + return false; + } + // Bo { std::vector phasePress = { pressure }; @@ -771,6 +777,12 @@ bool RigFlowDiagSolverInterface::calculatePvtDynamicPropertiesViscosity(size_t a return false; } + CVF_ASSERT(m_opmFlowDiagStaticData.notNull()); + if (!m_opmFlowDiagStaticData->m_eclPvtCurveCollection) + { + return false; + } + // mu_o { std::vector phasePress = { pressure };