mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1257 Added null pointer guarding based on reports from CppCheck
This commit is contained in:
parent
85228ee39c
commit
a29f6abc32
@ -606,12 +606,14 @@ void RiaApplication::loadAndUpdatePlotData()
|
||||
}
|
||||
}
|
||||
|
||||
plotProgress.setNextProgressIncrement(flowColl->plotCount());
|
||||
|
||||
if (flowColl)
|
||||
{
|
||||
flowColl->loadDataAndUpdate();
|
||||
|
||||
plotProgress.setNextProgressIncrement(flowColl->plotCount());
|
||||
}
|
||||
|
||||
plotProgress.incrementProgress();
|
||||
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ bool RicDeleteWellLogPlotTrackFeature::isCommandEnabled()
|
||||
{
|
||||
RimWellLogPlot* wellLogPlot = NULL;
|
||||
selection[0]->firstAncestorOrThisOfType(wellLogPlot);
|
||||
if (wellLogPlot->trackCount() > 1)
|
||||
if (wellLogPlot && wellLogPlot->trackCount() > 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ bool RimCellRangeFilter::isRangeFilterControlled()
|
||||
CVF_ASSERT(rimView);
|
||||
|
||||
bool isRangeFilterControlled = false;
|
||||
if (rimView->viewController() && rimView->viewController()->isRangeFiltersControlled())
|
||||
if (rimView && rimView->viewController() && rimView->viewController()->isRangeFiltersControlled())
|
||||
{
|
||||
isRangeFilterControlled = true;
|
||||
}
|
||||
|
@ -148,6 +148,7 @@ void RimCellRangeFilterCollection::updateDisplayModeNotifyManagedViews(RimCellRa
|
||||
{
|
||||
RimView* view = NULL;
|
||||
firstAncestorOrThisOfType(view);
|
||||
if (!view) return;
|
||||
|
||||
if (view->isMasterView())
|
||||
{
|
||||
|
@ -242,11 +242,15 @@ bool RimEclipsePropertyFilter::isPropertyFilterControlled()
|
||||
CVF_ASSERT(rimView);
|
||||
|
||||
bool isPropertyFilterControlled = false;
|
||||
|
||||
if (rimView)
|
||||
{
|
||||
RimViewController* vc = rimView->viewController();
|
||||
if (vc && vc->isPropertyFilterOveridden())
|
||||
{
|
||||
isPropertyFilterControlled = true;
|
||||
}
|
||||
}
|
||||
|
||||
return isPropertyFilterControlled;
|
||||
}
|
||||
|
@ -142,12 +142,15 @@ void RimEclipsePropertyFilterCollection::updateIconState()
|
||||
|
||||
RimEclipseView* view = NULL;
|
||||
this->firstAncestorOrThisOfType(view);
|
||||
if (view)
|
||||
{
|
||||
RimViewController* viewController = view->viewController();
|
||||
if (viewController && (viewController->isPropertyFilterOveridden()
|
||||
|| viewController->isVisibleCellsOveridden()))
|
||||
{
|
||||
activeIcon = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isActive)
|
||||
{
|
||||
|
@ -593,10 +593,14 @@ RigFlowDiagResultAddress RimEclipseResultDefinition::flowDiagResAddress() const
|
||||
{
|
||||
CVF_ASSERT(m_resultType() == RimDefines::FLOW_DIAGNOSTICS);
|
||||
|
||||
size_t timeStep = 0;
|
||||
|
||||
RimView* rimView = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimView);
|
||||
|
||||
size_t timeStep = rimView->currentTimeStep();
|
||||
if (rimView)
|
||||
{
|
||||
timeStep = rimView->currentTimeStep();
|
||||
}
|
||||
|
||||
std::set<std::string> selTracerNames;
|
||||
if (m_flowTracerSelectionMode == FLOW_TR_BY_SELECTION)
|
||||
|
@ -55,6 +55,8 @@ void RimGeoMechCellColors::updateIconState()
|
||||
this->firstAncestorOrThisOfType(rimView);
|
||||
CVF_ASSERT(rimView);
|
||||
|
||||
if (rimView)
|
||||
{
|
||||
RimViewController* viewController = rimView->viewController();
|
||||
if (viewController && viewController->isResultColorControlled())
|
||||
{
|
||||
@ -64,6 +66,7 @@ void RimGeoMechCellColors::updateIconState()
|
||||
{
|
||||
updateUiIconFromState(true);
|
||||
}
|
||||
}
|
||||
|
||||
uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
@ -190,16 +190,19 @@ void RimGeoMechPropertyFilter::updateReadOnlyStateOfAllFields()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGeoMechPropertyFilter::isPropertyFilterControlled()
|
||||
{
|
||||
bool isPropertyFilterControlled = false;
|
||||
|
||||
RimView* rimView = NULL;
|
||||
firstAncestorOrThisOfType(rimView);
|
||||
CVF_ASSERT(rimView);
|
||||
|
||||
bool isPropertyFilterControlled = false;
|
||||
if (rimView)
|
||||
{
|
||||
RimViewController* vc = rimView->viewController();
|
||||
if (vc && vc->isPropertyFilterOveridden())
|
||||
{
|
||||
isPropertyFilterControlled = true;
|
||||
}
|
||||
}
|
||||
|
||||
return isPropertyFilterControlled;
|
||||
}
|
||||
|
@ -144,12 +144,15 @@ void RimGeoMechPropertyFilterCollection::updateIconState()
|
||||
|
||||
RimGeoMechView* view = NULL;
|
||||
this->firstAncestorOrThisOfType(view);
|
||||
if (view)
|
||||
{
|
||||
RimViewController* viewController = view->viewController();
|
||||
if (viewController && ( viewController->isPropertyFilterOveridden()
|
||||
|| viewController->isVisibleCellsOveridden()))
|
||||
{
|
||||
activeIcon = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isActive)
|
||||
{
|
||||
|
@ -82,7 +82,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate()
|
||||
firstAncestorOrThisOfType(wellLogPlot);
|
||||
CVF_ASSERT(wellLogPlot);
|
||||
|
||||
if (wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH)
|
||||
if (wellLogPlot && wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH)
|
||||
{
|
||||
if (RiaApplication::instance()->preferences()->showLasCurveWithoutTvdWarning())
|
||||
{
|
||||
|
@ -435,7 +435,10 @@ void RimSummaryCurveFilter::updatePlotAxisForCurves()
|
||||
|
||||
RimSummaryPlot* plot = nullptr;
|
||||
firstAncestorOrThisOfType(plot);
|
||||
if (plot)
|
||||
{
|
||||
plot->updateAxes();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -311,6 +311,7 @@ void RimSummaryTimeAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* c
|
||||
{
|
||||
RimSummaryPlot* rimSummaryPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimSummaryPlot);
|
||||
if (!rimSummaryPlot) return;
|
||||
|
||||
if (changedField == &m_visibleDateRangeMax)
|
||||
{
|
||||
|
@ -155,14 +155,17 @@ bool RimSummaryYAxisProperties::isActive() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryYAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
RimSummaryPlot* rimSummaryPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimSummaryPlot);
|
||||
|
||||
if (changedField == &isAutoTitle)
|
||||
{
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
else if (changedField == &visibleRangeMax)
|
||||
|
||||
RimSummaryPlot* rimSummaryPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimSummaryPlot);
|
||||
if (rimSummaryPlot)
|
||||
{
|
||||
if (changedField == &visibleRangeMax)
|
||||
{
|
||||
if (visibleRangeMin > visibleRangeMax) visibleRangeMax = oldValue.toDouble();
|
||||
|
||||
@ -183,6 +186,7 @@ void RimSummaryYAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* chan
|
||||
{
|
||||
rimSummaryPlot->updateAxes();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user