mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 07:03:25 -06:00
#1257 More null pointer guards based on CppCheck
This commit is contained in:
parent
bf1f8fcbaa
commit
48599f7a94
@ -61,7 +61,7 @@ void RimGridCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField
|
||||
this->firstAncestorOrThisOfType(rimView);
|
||||
CVF_ASSERT(rimView);
|
||||
|
||||
rimView->showGridCells(isActive);
|
||||
if (rimView) rimView->showGridCells(isActive);
|
||||
|
||||
updateUiIconFromState(isActive);
|
||||
}
|
||||
|
@ -351,6 +351,8 @@ void RimIntersectionBox::updateBoxManipulatorGeometry()
|
||||
|
||||
RimView* rimView = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimView);
|
||||
if (!rimView) return;
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> transForm = rimView->displayCoordTransform();
|
||||
|
||||
m_boxManipulator->setOrigin(transForm->transformToDisplayCoord(boxOrigin().translation()));
|
||||
@ -468,10 +470,12 @@ void RimIntersectionBox::initAfterRead()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionBox::slotScheduleRedraw()
|
||||
{
|
||||
RimView* rimView = nullptr;
|
||||
RimView* rimView = NULL;
|
||||
this->firstAncestorOrThisOfType(rimView);
|
||||
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
if (rimView)
|
||||
{
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -516,12 +520,7 @@ void RimIntersectionBox::rebuildGeometryAndScheduleCreateDisplayModel()
|
||||
{
|
||||
m_intersectionBoxPartMgr = nullptr;
|
||||
|
||||
RimView* rimView = NULL;
|
||||
this->firstAncestorOrThisOfType(rimView);
|
||||
if (rimView)
|
||||
{
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
slotScheduleRedraw();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -49,6 +49,7 @@ void RimPropertyFilterCollection::updateDisplayModelNotifyManagedViews() const
|
||||
RimView* view = NULL;
|
||||
this->firstAncestorOrThisOfType(view);
|
||||
CVF_ASSERT(view);
|
||||
if (!view) return;
|
||||
|
||||
view->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
|
@ -362,12 +362,19 @@ void RimViewController::removeOverrides(RimView* view)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::updateOptionSensitivity()
|
||||
{
|
||||
RimViewLinker* linkedViews = NULL;
|
||||
firstAncestorOrThisOfType(linkedViews);
|
||||
CVF_ASSERT(linkedViews);
|
||||
RimView* mainView = nullptr;
|
||||
|
||||
{
|
||||
RimViewLinker* linkedViews = nullptr;
|
||||
firstAncestorOrThisOfType(linkedViews);
|
||||
CVF_ASSERT(linkedViews);
|
||||
|
||||
RimView* mainView = linkedViews->masterView();
|
||||
CVF_ASSERT(mainView);
|
||||
if (linkedViews)
|
||||
{
|
||||
mainView = linkedViews->masterView();
|
||||
}
|
||||
CVF_ASSERT(mainView);
|
||||
}
|
||||
|
||||
RimEclipseView* eclipseMasterView = dynamic_cast<RimEclipseView*>(mainView);
|
||||
RimGeoMechView* geoMasterView = dynamic_cast<RimGeoMechView*>(mainView);
|
||||
|
@ -289,8 +289,10 @@ QString RimViewLinker::displayNameForView(RimView* view)
|
||||
{
|
||||
RimCase* rimCase = NULL;
|
||||
view->firstAncestorOrThisOfType(rimCase);
|
||||
|
||||
displayName = rimCase->caseUserDescription() + ": " + view->name;
|
||||
if (rimCase)
|
||||
{
|
||||
displayName = rimCase->caseUserDescription() + ": " + view->name;
|
||||
}
|
||||
}
|
||||
|
||||
return displayName;
|
||||
|
@ -235,6 +235,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate()
|
||||
RimWellLogPlotCollection* wellLogCollection = NULL;
|
||||
this->firstAncestorOrThisOfType(wellLogCollection);
|
||||
CVF_ASSERT(wellLogCollection);
|
||||
if (!wellLogCollection) return;
|
||||
|
||||
cvf::ref<RigEclipseWellLogExtractor> eclExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, eclipseCase);
|
||||
cvf::ref<RigGeoMechWellLogExtractor> geomExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, geomCase);
|
||||
@ -299,6 +300,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate()
|
||||
RimWellLogPlot* wellLogPlot;
|
||||
firstAncestorOrThisOfType(wellLogPlot);
|
||||
CVF_ASSERT(wellLogPlot);
|
||||
if (!wellLogPlot) return;
|
||||
|
||||
displayUnit = wellLogPlot->depthUnit();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user