From 25921d1169fa783dc9d2ddd4e5ed9c5506d64323 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 8 Jun 2026 16:09:17 +0200 Subject: [PATCH] #14161 Fix crash in sim well centerline from null eclipse case calculateWellPipeStaticCenterline dereferenced eclipseView->eclipseCase() without checking for null. When the view has no eclipse case (or no case data), calling eclipseCaseData() on the null RimEclipseCase segfaulted during a timestep frame change that redraws simulation well pipes. Add the same null guard already used by the sibling method RimSimWellInView::wellHeadTopBottomPosition, returning early so no pipe geometry is produced when there is no case data. --- .../Well/RigSimulationWellCenterLineCalculator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ApplicationLibCode/ReservoirDataModel/Well/RigSimulationWellCenterLineCalculator.cpp b/ApplicationLibCode/ReservoirDataModel/Well/RigSimulationWellCenterLineCalculator.cpp index 0577ad0139..f1ef504c97 100644 --- a/ApplicationLibCode/ReservoirDataModel/Well/RigSimulationWellCenterLineCalculator.cpp +++ b/ApplicationLibCode/ReservoirDataModel/Well/RigSimulationWellCenterLineCalculator.cpp @@ -129,6 +129,8 @@ void RigSimulationWellCenterLineCalculator::calculateWellPipeStaticCenterline( c auto eclipseView = rimWell->firstAncestorOrThisOfTypeAsserted(); + if ( !eclipseView->eclipseCase() || !eclipseView->eclipseCase()->eclipseCaseData() ) return; + RigEclipseCaseData* eclipseCaseData = eclipseView->eclipseCase()->eclipseCaseData(); bool isAutoDetectBranches = eclipseView->wellCollection()->isAutoDetectingBranches();