diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp index 6a4aaa694c..66cfc8885e 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp @@ -312,19 +312,23 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate(bool updateParentPlot) RimWellLogPlotCollection* wellLogCollection = mainPlotCollection->wellLogPlotCollection(); cvf::ref eclExtractor; - if ( m_trajectoryType == WELL_PATH ) + + if (eclipseCase) { - eclExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, eclipseCase); - } - else - { - if (m_branchIndex >= 0 && m_branchIndex < static_cast(m_generatedSimulationWellPathBranches.size()) ) + if (m_trajectoryType == WELL_PATH) { - eclExtractor = wellLogCollection->findOrCreateSimWellExtractor(m_simWellName, - eclipseCase->caseUserDescription(), - m_generatedSimulationWellPathBranches[m_branchIndex].p(), - eclipseCase->eclipseCaseData()); - isUsingPseudoLength = true; + eclExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, eclipseCase); + } + else + { + if (m_branchIndex >= 0 && m_branchIndex < static_cast(m_generatedSimulationWellPathBranches.size())) + { + eclExtractor = wellLogCollection->findOrCreateSimWellExtractor(m_simWellName, + eclipseCase->caseUserDescription(), + m_generatedSimulationWellPathBranches[m_branchIndex].p(), + eclipseCase->eclipseCaseData()); + isUsingPseudoLength = true; + } } } cvf::ref geomExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, geomCase); @@ -335,7 +339,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate(bool updateParentPlot) RiaDefines::DepthUnitType depthUnit = RiaDefines::UNIT_METER; - if (eclExtractor.notNull()) + if (eclExtractor.notNull() && eclipseCase) { measuredDepthValues = eclExtractor->measuredDepth(); tvDepthValues = eclExtractor->trueVerticalDepth(); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp index 199174dc52..144ab10123 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp @@ -465,8 +465,10 @@ RifReaderEclipseRft* RimWellLogRftCurve::rftReader() const //-------------------------------------------------------------------------------------------------- RigEclipseWellLogExtractor* RimWellLogRftCurve::extractor() { + if (!m_eclipseResultCase()) return nullptr; RifReaderEclipseRft* reader = rftReader(); if (!reader) return nullptr; + RimMainPlotCollection* mainPlotCollection; this->firstAncestorOrThisOfTypeAsserted(mainPlotCollection); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp index cc635b23a5..5a6361c149 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp @@ -978,7 +978,8 @@ RigEclipseWellLogExtractor* RimWellLogTrack::createSimWellExtractor(RimWellLogPl if (!wellLogCollection) return nullptr; RimEclipseCase* eclipseCase = dynamic_cast(rimCase); - + if (!eclipseCase) return nullptr; + RimProject* proj = RiaApplication::instance()->project(); std::vector wellPaths = proj->simulationWellBranches(simWellName);