#14450 Guard against missing data source in RFT plot

RimWellRftPlot::dataSource() returned a default constructed variant when no source was selected. The variant then held a null RimSummaryCase pointer, and RicCreateRftPlotsFeature dereferenced it. Add std::monostate as first alternative to represent no data source.
This commit is contained in:
Magne Sjaastad committed 2026-08-05 09:20:35 +02:00
1 parent 656944c6fc
commit 3023e6e335
4 files changed
+43 -2

No files matched your search

@@ -1897,7 +1897,7 @@ void RimWellRftPlot::initializeDataSources( RimWellRftPlot* source )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::variant<RimSummaryCase*, RimSummaryEnsemble*> RimWellRftPlot::dataSource() const
std::variant<std::monostate, RimSummaryCase*, RimSummaryEnsemble*> RimWellRftPlot::dataSource() const
{
// Return the first selected ensemble, if any
// If no ensemble is selected, return the first selected summary case, if any