mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7778 Check for valid pointer to main window before use
This commit is contained in:
@@ -61,7 +61,10 @@ void RicExitApplicationFeature::onActionTriggered( bool isChecked )
|
||||
topLevelWidget->hide();
|
||||
}
|
||||
// Close just the main window, it'll take care of closing the plot window
|
||||
app->mainWindow()->close();
|
||||
if ( app->mainWindow() )
|
||||
{
|
||||
app->mainWindow()->close();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -136,13 +136,17 @@ caf::PdmUiTreeView* RicToggleItemsFeatureImpl::findTreeView( const caf::PdmUiIte
|
||||
return customActiveTreeView;
|
||||
}
|
||||
|
||||
caf::PdmUiTreeView* activeTree = RiuMainWindow::instance()->getTreeViewWithItem( uiItem );
|
||||
if ( activeTree ) return activeTree;
|
||||
auto* main3dWindow = RiaGuiApplication::instance()->mainWindow();
|
||||
if ( main3dWindow )
|
||||
{
|
||||
auto activeTree = main3dWindow->getTreeViewWithItem( uiItem );
|
||||
if ( activeTree ) return activeTree;
|
||||
}
|
||||
|
||||
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
|
||||
auto* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
|
||||
if ( mainPlotWindow )
|
||||
{
|
||||
activeTree = mainPlotWindow->getTreeViewWithItem( uiItem );
|
||||
auto activeTree = mainPlotWindow->getTreeViewWithItem( uiItem );
|
||||
if ( activeTree )
|
||||
{
|
||||
return activeTree;
|
||||
|
||||
Reference in New Issue
Block a user