mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix crash if 3d window is not there when importing summary data
This commit is contained in:
parent
26f1387bc6
commit
05ce13b533
@ -130,7 +130,7 @@ void RicImportEnsembleFeature::importSingleEnsemble( const QStringList&
|
||||
|
||||
if ( allCases.size() == 0 )
|
||||
{
|
||||
RiuMainWindow::instance()->close();
|
||||
RiuMainWindow::closeIfOpen();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ void RicImportSummaryCasesFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
if ( allCases.size() == 0 )
|
||||
{
|
||||
RiuMainWindow::instance()->close();
|
||||
RiuMainWindow::closeIfOpen();
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ bool RicImportSummaryCasesFeature::createAndAddSummaryCasesFromFiles( const QStr
|
||||
|
||||
if ( allCases.size() == 0 )
|
||||
{
|
||||
RiuMainWindow::instance()->close();
|
||||
RiuMainWindow::closeIfOpen();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -79,7 +79,7 @@ void RicImportSummaryGroupFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
if ( allCases.size() == 0 )
|
||||
{
|
||||
RiuMainWindow::instance()->close();
|
||||
RiuMainWindow::closeIfOpen();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -500,7 +500,7 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
RiuPlotMainWindowTools::setExpanded( lastPlotCreated );
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( lastPlotCreated );
|
||||
|
||||
RiuMainWindow::instance()->close();
|
||||
RiuMainWindow::closeIfOpen();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -192,6 +192,14 @@ RiuMainWindow* RiuMainWindow::instance()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::closeIfOpen()
|
||||
{
|
||||
if ( instance() != nullptr ) instance()->close();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -83,6 +83,7 @@ public:
|
||||
~RiuMainWindow() override;
|
||||
|
||||
static RiuMainWindow* instance();
|
||||
static void closeIfOpen();
|
||||
|
||||
QString mainWindowName() override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user