From db1510232d79c5429ebf268cc95eb0e7dcfbfc50 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Sun, 11 Oct 2026 19:12:43 +0200 Subject: [PATCH] #14906: FlowRateCurve: Guard against null plot curve in onLoadDataAndUpdate Crash signature 9f3186ce4814. RimWellFlowRateCurve::onLoadDataAndUpdate calls m_plotCurve->setTitle() after updateCurvePresentation(). Turning Show Curve off makes that call detach( true ), which deletes m_plotCurve and sets it to null, so the next line dereferences null. Only call setTitle() when m_plotCurve is not null. Call stack: [3] RimWellFlowRateCurve::onLoadDataAndUpdate(bool) at ResInsight/ApplicationLibCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp:166 [4] RimPlotCurve::loadDataAndUpdate(bool) at ResInsight/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp:587 [5] non-virtual thunk to RimWellFlowRateCurve::fieldChangedByUi(caf::PdmFieldHandle const*, QVariant const&, QVariant const&) at ResInsight/ApplicationLibCode/ProjectDataModel/Flow/RimWellFlowRateCurve.h:63 [6] caf::PdmUiFieldHandle::notifyFieldChanged(QVariant const&, QVariant const&) at ResInsight/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiFieldHandle.cpp:75 [7] caf::PdmFieldUiCap >::setValueFromUiEditor(QVariant const&, bool) at ResInsight/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafInternalPdmUiFieldCapability.inl:116 [8] caf::CmdFieldChangeExec::redo() at ResInsight/Fwk/AppFwk/cafCommand/cafCmdFieldChangeExec.cpp:139 [10] caf::CmdUiCommandSystemImpl::fieldChangedCommand(std::vector > const&, QVariant const&) at ResInsight/Fwk/AppFwk/cafCommand/cafCmdUiCommandSystemImpl.cpp:146 [11] caf::PdmUiCommandSystemProxy::setUiValueToField(caf::PdmUiFieldHandle*, QVariant const&) at ResInsight/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiCommandSystemProxy.cpp:113 [12] caf::PdmUiTreeViewQModel::setData(QModelIndex const&, QVariant const&, int) at ResInsight/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewQModel.cpp:761 [23] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1828 [29] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1828 [40] main at ResInsight/ApplicationExeCode/RiaMain.cpp:267 [41] __libc_start_main at :0 --- .../ProjectDataModel/Flow/RimWellFlowRateCurve.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp index 4238a64e79..32fdaa1fb7 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp @@ -163,7 +163,7 @@ void RimWellFlowRateCurve::onLoadDataAndUpdate( bool updateParentPlot ) { RimPlotCurve::updateCurvePresentation( updateParentPlot ); - m_plotCurve->setTitle( createCurveAutoName() ); + if ( m_plotCurve ) m_plotCurve->setTitle( createCurveAutoName() ); if ( updateParentPlot ) {