mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-27 07:30:20 -05:00
#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:
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
|
||||
|
||||
@@ -88,7 +88,8 @@ public:
|
||||
|
||||
int branchIndex() const;
|
||||
|
||||
std::variant<RimSummaryCase*, RimSummaryEnsemble*> dataSource() const;
|
||||
// The monostate is used to indicate that no data source is selected
|
||||
std::variant<std::monostate, RimSummaryCase*, RimSummaryEnsemble*> dataSource() const;
|
||||
|
||||
static const char* plotNameFormatString();
|
||||
|
||||
|
||||
Reference in new issue
Block a user