mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add guard against null pointer access
This commit is contained in:
parent
071082a7df
commit
018aea4f58
@ -68,9 +68,6 @@ void RicConvertFractureTemplateUnitFeature::onActionTriggered(bool isChecked)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicConvertFractureTemplateUnitFeature::setupActionLook(QAction* actionToSetup)
|
void RicConvertFractureTemplateUnitFeature::setupActionLook(QAction* actionToSetup)
|
||||||
{
|
{
|
||||||
actionToSetup->setIcon(QIcon(":/FractureTemplate16x16.png"));
|
|
||||||
//TODO: Add unit to text
|
|
||||||
|
|
||||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||||
if (!pdmUiItem) return;
|
if (!pdmUiItem) return;
|
||||||
|
|
||||||
@ -79,6 +76,7 @@ void RicConvertFractureTemplateUnitFeature::setupActionLook(QAction* actionToSet
|
|||||||
|
|
||||||
RimEllipseFractureTemplate* ellipseFractureTemplate = nullptr;
|
RimEllipseFractureTemplate* ellipseFractureTemplate = nullptr;
|
||||||
objHandle->firstAncestorOrThisOfType(ellipseFractureTemplate);
|
objHandle->firstAncestorOrThisOfType(ellipseFractureTemplate);
|
||||||
|
if (!ellipseFractureTemplate) return;
|
||||||
|
|
||||||
QString text = "Convert Values to ";
|
QString text = "Convert Values to ";
|
||||||
if (ellipseFractureTemplate->fractureTemplateUnit == RiaEclipseUnitTools::UNITS_METRIC)
|
if (ellipseFractureTemplate->fractureTemplateUnit == RiaEclipseUnitTools::UNITS_METRIC)
|
||||||
@ -90,6 +88,9 @@ void RicConvertFractureTemplateUnitFeature::setupActionLook(QAction* actionToSet
|
|||||||
text += "Metric";
|
text += "Metric";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actionToSetup->setIcon(QIcon(":/FractureTemplate16x16.png"));
|
||||||
|
//TODO: Add unit to text
|
||||||
|
|
||||||
actionToSetup->setText(text);
|
actionToSetup->setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user