mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
System : Added asserts and initialized pointer before calling firstAnchestorOrThisOfType()
This commit is contained in:
@@ -51,6 +51,7 @@ void RicShowAllLinkedViewsFeature::onActionTriggered(bool isChecked)
|
|||||||
{
|
{
|
||||||
RimViewLinker* rimLinked = NULL;
|
RimViewLinker* rimLinked = NULL;
|
||||||
managedViews[i]->firstAnchestorOrThisOfType(rimLinked);
|
managedViews[i]->firstAnchestorOrThisOfType(rimLinked);
|
||||||
|
CVF_ASSERT(rimLinked);
|
||||||
|
|
||||||
linkedViews.push_back(rimLinked);
|
linkedViews.push_back(rimLinked);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,10 +80,10 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked)
|
|||||||
{
|
{
|
||||||
RimWellLogFileChannel* wellLog = selection[wlIdx];
|
RimWellLogFileChannel* wellLog = selection[wlIdx];
|
||||||
|
|
||||||
RimWellPath* wellPath;
|
RimWellPath* wellPath = NULL;
|
||||||
wellLog->firstAnchestorOrThisOfType(wellPath);
|
wellLog->firstAnchestorOrThisOfType(wellPath);
|
||||||
|
|
||||||
RimWellLogFile* wellLogFile;
|
RimWellLogFile* wellLogFile = NULL;
|
||||||
wellLog->firstAnchestorOrThisOfType(wellLogFile);
|
wellLog->firstAnchestorOrThisOfType(wellLogFile);
|
||||||
if (wellLogFile)
|
if (wellLogFile)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -293,6 +293,7 @@ void RivFemPartPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechCe
|
|||||||
|
|
||||||
RimView* view = NULL;
|
RimView* view = NULL;
|
||||||
cellResultColors->firstAnchestorOrThisOfType(view);
|
cellResultColors->firstAnchestorOrThisOfType(view);
|
||||||
|
CVF_ASSERT(view);
|
||||||
|
|
||||||
RivScalarMapperUtils::applyTextureResultsToPart(m_surfaceFaces.p(), m_surfaceFacesTextureCoords.p(), mapper, m_opacityLevel, caf::FC_NONE, view->isLightingDisabled());
|
RivScalarMapperUtils::applyTextureResultsToPart(m_surfaceFaces.p(), m_surfaceFacesTextureCoords.p(), mapper, m_opacityLevel, caf::FC_NONE, view->isLightingDisabled());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ void RimGeoMechCellColors::updateIconState()
|
|||||||
{
|
{
|
||||||
RimView* rimView = NULL;
|
RimView* rimView = NULL;
|
||||||
this->firstAnchestorOrThisOfType(rimView);
|
this->firstAnchestorOrThisOfType(rimView);
|
||||||
|
CVF_ASSERT(rimView);
|
||||||
|
|
||||||
RimViewController* viewController = rimView->viewController();
|
RimViewController* viewController = rimView->viewController();
|
||||||
if (viewController && viewController->isResultColorControlled())
|
if (viewController && viewController->isResultColorControlled())
|
||||||
|
|||||||
@@ -134,8 +134,6 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createResultAccessor(RigCa
|
|||||||
CVF_ASSERT(eclipseCase->results(porosityModel));
|
CVF_ASSERT(eclipseCase->results(porosityModel));
|
||||||
CVF_ASSERT(eclipseCase->activeCellInfo(porosityModel));
|
CVF_ASSERT(eclipseCase->activeCellInfo(porosityModel));
|
||||||
|
|
||||||
RigGridBase *grid = eclipseCase->grid(gridIndex);
|
|
||||||
|
|
||||||
if (!eclipseCase || !eclipseCase->results(porosityModel) || !eclipseCase->activeCellInfo(porosityModel))
|
if (!eclipseCase || !eclipseCase->results(porosityModel) || !eclipseCase->activeCellInfo(porosityModel))
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -164,8 +162,6 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createNativeResultAccessor
|
|||||||
CVF_ASSERT(eclipseCase->results(porosityModel));
|
CVF_ASSERT(eclipseCase->results(porosityModel));
|
||||||
CVF_ASSERT(eclipseCase->activeCellInfo(porosityModel));
|
CVF_ASSERT(eclipseCase->activeCellInfo(porosityModel));
|
||||||
|
|
||||||
RigGridBase *grid = eclipseCase->grid(gridIndex);
|
|
||||||
|
|
||||||
if (!eclipseCase || !eclipseCase->results(porosityModel) || !eclipseCase->activeCellInfo(porosityModel))
|
if (!eclipseCase || !eclipseCase->results(porosityModel) || !eclipseCase->activeCellInfo(porosityModel))
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user