mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5102 Janitor : Guard null pointer access
This commit is contained in:
parent
5cfab3c497
commit
bfdc84a744
@ -54,8 +54,7 @@ bool RicPasteAsciiDataToSummaryPlotFeature::isCommandEnabled()
|
||||
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
|
||||
caf::SelectionManager::instance()->selectedItem() );
|
||||
|
||||
RimSummaryPlot* summaryPlot = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType( summaryPlot );
|
||||
if ( !destinationObject ) return false;
|
||||
|
||||
RimSummaryPlotCollection* summaryPlotCollection = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType( summaryPlotCollection );
|
||||
|
@ -67,6 +67,7 @@ RimEnsembleCurveSet*
|
||||
bool RicPasteEnsembleCurveSetFeature::isCommandEnabled()
|
||||
{
|
||||
caf::PdmObject* destinationObject = dynamic_cast<caf::PdmObject*>( caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( !destinationObject ) return false;
|
||||
|
||||
RimSummaryPlot* plot = nullptr;
|
||||
RimEnsembleCurveSetCollection* coll = nullptr;
|
||||
|
@ -80,6 +80,7 @@ void RicPasteSummaryCaseFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
|
||||
caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( !destinationObject ) return;
|
||||
|
||||
std::vector<caf::PdmPointer<RimSummaryCase>> sourceObjects = RicPasteSummaryCaseFeature::summaryCases();
|
||||
|
||||
@ -162,4 +163,4 @@ void RicPasteSummaryCaseFeature::removeFromSourceCollection( RimSummaryCase* sum
|
||||
sourceSummaryCaseMainCollection->removeCase( summaryCase );
|
||||
sourceSummaryCaseMainCollection->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,6 +69,7 @@ bool RicPasteSummaryCrossPlotFeature::isCommandEnabled()
|
||||
{
|
||||
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
|
||||
caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( !destinationObject ) return false;
|
||||
|
||||
RimSummaryCrossPlotCollection* plotColl = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType( plotColl );
|
||||
|
@ -74,6 +74,7 @@ RimSummaryCurve* RicPasteSummaryCurveFeature::copyCurveAndAddToPlot( RimSummaryC
|
||||
bool RicPasteSummaryCurveFeature::isCommandEnabled()
|
||||
{
|
||||
caf::PdmObject* destinationObject = dynamic_cast<caf::PdmObject*>( caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( !destinationObject ) return false;
|
||||
|
||||
RimSummaryPlot* summaryPlot = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType( summaryPlot );
|
||||
|
@ -70,6 +70,8 @@ bool RicPasteSummaryPlotFeature::isCommandEnabled()
|
||||
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
|
||||
caf::SelectionManager::instance()->selectedItem() );
|
||||
|
||||
if ( !destinationObject ) return false;
|
||||
|
||||
RimSummaryPlotCollection* plotColl = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType( plotColl );
|
||||
if ( !plotColl )
|
||||
|
@ -46,6 +46,7 @@ bool RicPasteWellLogCurveFeature::isCommandEnabled()
|
||||
|
||||
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
|
||||
caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( !destinationObject ) return false;
|
||||
|
||||
RimWellLogTrack* wellLogTrack = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType( wellLogTrack );
|
||||
@ -66,6 +67,7 @@ void RicPasteWellLogCurveFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
|
||||
caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( !destinationObject ) return;
|
||||
|
||||
RimWellLogTrack* wellLogTrack = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType( wellLogTrack );
|
||||
|
@ -40,6 +40,7 @@ bool RicPasteWellLogPlotFeature::isCommandEnabled()
|
||||
{
|
||||
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
|
||||
caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( !destinationObject ) return false;
|
||||
|
||||
RimWellLogPlotCollection* wellLogPlotCollection = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType( wellLogPlotCollection );
|
||||
@ -58,6 +59,7 @@ void RicPasteWellLogPlotFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
|
||||
caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( !destinationObject ) return;
|
||||
|
||||
RimWellLogPlotCollection* wellLogPlotCollection = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType( wellLogPlotCollection );
|
||||
|
@ -44,6 +44,7 @@ bool RicPasteWellLogTrackFeature::isCommandEnabled()
|
||||
|
||||
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
|
||||
caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( !destinationObject ) return false;
|
||||
|
||||
RimWellLogPlot* wellLogPlot = nullptr;
|
||||
RimWellRftPlot* rftPlot = nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user