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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user