From c687a5bb5ea8d54412462b24558a2285b2ddd2a8 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 1 Oct 2018 20:44:32 +0200 Subject: [PATCH] Summary Plot : Guard null pointer access --- .../ProjectDataModel/Summary/RimSummaryPlot.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index 5a44fb4081..a91af8ad5f 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -485,7 +485,10 @@ void RimSummaryPlot::updateAll() void RimSummaryPlot::updateAllLegendItems() { reattachAllCurves(); - qwtPlot()->updateLegend(); + if (qwtPlot()) + { + qwtPlot()->updateLegend(); + } } //-------------------------------------------------------------------------------------------------- @@ -985,7 +988,7 @@ void RimSummaryPlot::deleteCurves(const std::vector& curves) curveSet->deleteCurve(curve); if (curveSet->curves().empty()) { - if (curveSet->colorMode() == RimEnsembleCurveSet::BY_ENSEMBLE_PARAM) + if (curveSet->colorMode() == RimEnsembleCurveSet::BY_ENSEMBLE_PARAM && qwtPlot()) { qwtPlot()->removeEnsembleCurveSetLegend(curveSet); }