From 41735344c0a8eb7c3107ef27379eaaaf4d4f8e1f Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Sun, 11 Oct 2026 08:27:08 +0200 Subject: [PATCH] #14897: Fix crash when updating track annotations before the plot widget exists RimWellRftPlot::updateFormationsOnPlot() runs during project load, before the track widgets are created. Skip the annotation update until the widget exists; onLoadDataAndUpdate() draws them later. Fixes #14897. --- .../WellLog/WellLogTrack/RimWellLogTrack.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/WellLogTrack/RimWellLogTrack.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/WellLogTrack/RimWellLogTrack.cpp index 0e4d15876a..7858f882b9 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/WellLogTrack/RimWellLogTrack.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/WellLogTrack/RimWellLogTrack.cpp @@ -665,7 +665,7 @@ void RimWellLogTrack::curveStackingChanged( const caf::SignalEmitter* emitter, b m_propertyAxisSettings->setAutoScaleEnabled( true ); updatePropertyValueZoom(); - m_plotWidget->scheduleReplot(); + if ( m_plotWidget ) m_plotWidget->scheduleReplot(); } //-------------------------------------------------------------------------------------------------- @@ -933,6 +933,8 @@ QString RimWellLogTrack::asciiDataForPlotExport() const //-------------------------------------------------------------------------------------------------- void RimWellLogTrack::updateAxisRangesFromPlotWidget() { + if ( !m_plotWidget ) return; + auto [xIntervalMin, xIntervalMax] = m_plotWidget->axisRange( valueAxis() ); auto [depthIntervalMin, depthIntervalMax] = m_plotWidget->axisRange( depthAxis() ); @@ -1617,7 +1619,7 @@ void RimWellLogTrack::updatePlotWidgetFromAxisRanges() { updatePropertyValueZoom(); updateDepthZoom(); - m_plotWidget->scheduleReplot(); + if ( m_plotWidget ) m_plotWidget->scheduleReplot(); } //-------------------------------------------------------------------------------------------------- @@ -2669,6 +2671,8 @@ void RimWellLogTrack::updateRegionAnnotationsOnPlot() { removeRegionAnnotations(); + if ( !m_plotWidget ) return; + if ( m_regionAnnotationSettings->annotationType() == RiaDefines::RegionAnnotationType::NO_ANNOTATIONS ) return; if ( m_annotationTool == nullptr ) @@ -3313,7 +3317,7 @@ void RimWellLogTrack::removeRegionAnnotations() void RimWellLogTrack::doUpdateLayout() { updateFonts(); - m_plotWidget->scheduleReplot(); + if ( m_plotWidget ) m_plotWidget->scheduleReplot(); } //--------------------------------------------------------------------------------------------------