System : Added asserts and initialized pointer before calling firstAnchestorOrThisOfType()

This commit is contained in:
Magne Sjaastad
2015-10-26 10:14:45 +01:00
parent 01224dd5e6
commit 930209f527
5 changed files with 5 additions and 6 deletions

View File

@@ -51,6 +51,7 @@ void RicShowAllLinkedViewsFeature::onActionTriggered(bool isChecked)
{
RimViewLinker* rimLinked = NULL;
managedViews[i]->firstAnchestorOrThisOfType(rimLinked);
CVF_ASSERT(rimLinked);
linkedViews.push_back(rimLinked);
}

View File

@@ -80,10 +80,10 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked)
{
RimWellLogFileChannel* wellLog = selection[wlIdx];
RimWellPath* wellPath;
RimWellPath* wellPath = NULL;
wellLog->firstAnchestorOrThisOfType(wellPath);
RimWellLogFile* wellLogFile;
RimWellLogFile* wellLogFile = NULL;
wellLog->firstAnchestorOrThisOfType(wellLogFile);
if (wellLogFile)
{

View File

@@ -293,6 +293,7 @@ void RivFemPartPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechCe
RimView* view = NULL;
cellResultColors->firstAnchestorOrThisOfType(view);
CVF_ASSERT(view);
RivScalarMapperUtils::applyTextureResultsToPart(m_surfaceFaces.p(), m_surfaceFacesTextureCoords.p(), mapper, m_opacityLevel, caf::FC_NONE, view->isLightingDisabled());
}

View File

@@ -52,6 +52,7 @@ void RimGeoMechCellColors::updateIconState()
{
RimView* rimView = NULL;
this->firstAnchestorOrThisOfType(rimView);
CVF_ASSERT(rimView);
RimViewController* viewController = rimView->viewController();
if (viewController && viewController->isResultColorControlled())

View File

@@ -134,8 +134,6 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createResultAccessor(RigCa
CVF_ASSERT(eclipseCase->results(porosityModel));
CVF_ASSERT(eclipseCase->activeCellInfo(porosityModel));
RigGridBase *grid = eclipseCase->grid(gridIndex);
if (!eclipseCase || !eclipseCase->results(porosityModel) || !eclipseCase->activeCellInfo(porosityModel))
{
return NULL;
@@ -164,8 +162,6 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createNativeResultAccessor
CVF_ASSERT(eclipseCase->results(porosityModel));
CVF_ASSERT(eclipseCase->activeCellInfo(porosityModel));
RigGridBase *grid = eclipseCase->grid(gridIndex);
if (!eclipseCase || !eclipseCase->results(porosityModel) || !eclipseCase->activeCellInfo(porosityModel))
{
return NULL;