mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
CppCheck : Avoid potential null pointer access
This commit is contained in:
parent
ffb7e42b0f
commit
8ecfaa2ea7
@ -55,12 +55,8 @@ void RicNewSimWellFractureAtPosFeature::onActionTriggered(bool isChecked)
|
||||
RiuSelectionManager* riuSelManager = RiuSelectionManager::instance();
|
||||
RiuSelectionItem* selItem = riuSelManager->selectedItem(RiuSelectionManager::RUI_TEMPORARY);
|
||||
|
||||
RiuSimWellSelectionItem* simWellItem = nullptr;
|
||||
if (selItem->type() == RiuSelectionItem::SIMWELL_SELECTION_OBJECT)
|
||||
{
|
||||
simWellItem = static_cast<RiuSimWellSelectionItem*>(selItem);
|
||||
if (!simWellItem) return;
|
||||
}
|
||||
RiuSimWellSelectionItem* simWellItem = static_cast<RiuSimWellSelectionItem*>(selItem);
|
||||
if (!simWellItem) return;
|
||||
|
||||
RimEclipseWell* simWell = simWellItem->m_simWell;
|
||||
if (!simWell) return;
|
||||
|
@ -321,6 +321,9 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
{
|
||||
caf::SelectionManager::instance()->setSelectedItem(well);
|
||||
|
||||
RiuSelectionItem* selItem = new RiuSimWellSelectionItem(eclipseWellSourceInfo->well(), m_currentPickPositionInDomainCoords, eclipseWellSourceInfo->branchIndex());
|
||||
RiuSelectionManager::instance()->setSelectedItem(selItem, RiuSelectionManager::RUI_TEMPORARY);
|
||||
|
||||
commandIds << "RicNewWellLogCurveExtractionFeature";
|
||||
commandIds << "RicShowWellAllocationPlotFeature";
|
||||
commandIds << "RicPlotProductionRateFeature";
|
||||
@ -328,10 +331,6 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
commandIds << "RicShowContributingWellsFeature";
|
||||
commandIds << "Separator";
|
||||
commandIds << "RicNewSimWellIntersectionFeature";
|
||||
|
||||
|
||||
RiuSelectionItem* selItem = new RiuSimWellSelectionItem(eclipseWellSourceInfo->well(), m_currentPickPositionInDomainCoords, eclipseWellSourceInfo->branchIndex());
|
||||
RiuSelectionManager::instance()->setSelectedItem(selItem, RiuSelectionManager::RUI_TEMPORARY);
|
||||
commandIds << "RicPlotProductionRateFeature";
|
||||
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
|
||||
commandIds << "RicNewSimWellFractureAtPosFeature";
|
||||
|
Loading…
Reference in New Issue
Block a user