#4178 Ensemble Diff : When well is present in only one ensemble, diff causes crash

This commit is contained in:
Magne Sjaastad
2019-03-22 08:21:43 +01:00
parent f8102797c1
commit 60c3f60146

View File

@@ -18,6 +18,7 @@
#include "RimDerivedEnsembleCase.h"
#include "RiaLogging.h"
#include "RiaSummaryTools.h"
#include "RiaTimeHistoryCurveMerger.h"
@@ -133,6 +134,16 @@ void RimDerivedEnsembleCase::calculate(const RifEclipseSummaryAddress& address)
RifSummaryReaderInterface* reader2 = m_summaryCase2 ? m_summaryCase2->summaryReader() : nullptr;
if (!reader1 || !reader2 || !parentEnsemble()) return;
if (!reader1->hasAddress(address) || !reader2->hasAddress(address))
{
std::string text = address.uiText();
RiaLogging::warning("Derived Ensemble : At least one of the ensembles does not contain the summary address : " +
QString::fromStdString(text));
return;
}
RiaTimeHistoryCurveMerger merger;
std::vector<double> values1;
std::vector<double> values2;