Guard for if eclipseCaseData is null

This commit is contained in:
Rebecca Cox 2017-12-01 15:39:34 +01:00
parent a5300032e9
commit 32c1fa25d5
3 changed files with 20 additions and 13 deletions

View File

@ -312,19 +312,23 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate(bool updateParentPlot)
RimWellLogPlotCollection* wellLogCollection = mainPlotCollection->wellLogPlotCollection();
cvf::ref<RigEclipseWellLogExtractor> eclExtractor;
if ( m_trajectoryType == WELL_PATH )
if (eclipseCase)
{
eclExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, eclipseCase);
}
else
{
if (m_branchIndex >= 0 && m_branchIndex < static_cast<int>(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<int>(m_generatedSimulationWellPathBranches.size()))
{
eclExtractor = wellLogCollection->findOrCreateSimWellExtractor(m_simWellName,
eclipseCase->caseUserDescription(),
m_generatedSimulationWellPathBranches[m_branchIndex].p(),
eclipseCase->eclipseCaseData());
isUsingPseudoLength = true;
}
}
}
cvf::ref<RigGeoMechWellLogExtractor> 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();

View File

@ -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);

View File

@ -978,7 +978,8 @@ RigEclipseWellLogExtractor* RimWellLogTrack::createSimWellExtractor(RimWellLogPl
if (!wellLogCollection) return nullptr;
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(rimCase);
if (!eclipseCase) return nullptr;
RimProject* proj = RiaApplication::instance()->project();
std::vector<const RigWellPath*> wellPaths = proj->simulationWellBranches(simWellName);