CppCheck : Several fixes

Add missing initializers
Guard potential null pointer access
This commit is contained in:
Magne Sjaastad
2018-08-02 19:22:03 +02:00
parent 39c4319fa4
commit fe07b60392
21 changed files with 184 additions and 148 deletions

View File

@@ -325,9 +325,18 @@ void RiuSelectionChangedHandler::updateResultInfo(const RiuSelectionItem* itemAd
if (selItem->type() == RiuSelectionItem::INTERSECTION_SELECTION_OBJECT)
{
const Riu2dIntersectionSelectionItem* wrapperSelItem = dynamic_cast<Riu2dIntersectionSelectionItem*>(selItem);
intersectionView = wrapperSelItem->view();
if (wrapperSelItem && wrapperSelItem->eclipseSelectionItem()) selItem = wrapperSelItem->eclipseSelectionItem();
else if (wrapperSelItem && wrapperSelItem->geoMechSelectionItem()) selItem = wrapperSelItem->geoMechSelectionItem();
if (wrapperSelItem)
{
intersectionView = wrapperSelItem->view();
if (wrapperSelItem->eclipseSelectionItem())
{
selItem = wrapperSelItem->eclipseSelectionItem();
}
else if (wrapperSelItem->geoMechSelectionItem())
{
selItem = wrapperSelItem->geoMechSelectionItem();
}
}
}
if (selItem->type() == RiuSelectionItem::ECLIPSE_SELECTION_OBJECT)