#1257 More null pointer guards based on CppCheck

This commit is contained in:
Magne Sjaastad
2017-02-24 16:16:58 +01:00
parent bf1f8fcbaa
commit 48599f7a94
6 changed files with 28 additions and 17 deletions

View File

@@ -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);