mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Guard use of nullpointer
This commit is contained in:
@@ -44,11 +44,15 @@ RiuMdiArea::~RiuMdiArea()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaDefines::WindowTileMode RiuMdiArea::tileMode() const
|
||||
{
|
||||
auto* mainWindow = dynamic_cast<RiuMainWindow*>( window() );
|
||||
if ( mainWindow ) return RimProject::current()->subWindowsTileMode3DWindow();
|
||||
auto proj = RimProject::current();
|
||||
if ( proj )
|
||||
{
|
||||
auto* mainWindow = dynamic_cast<RiuMainWindow*>( window() );
|
||||
if ( mainWindow ) return proj->subWindowsTileMode3DWindow();
|
||||
|
||||
auto* plotMainWindow = dynamic_cast<RiuPlotMainWindow*>( window() );
|
||||
if ( plotMainWindow ) return RimProject::current()->subWindowsTileModePlotWindow();
|
||||
auto* plotMainWindow = dynamic_cast<RiuPlotMainWindow*>( window() );
|
||||
if ( plotMainWindow ) return proj->subWindowsTileModePlotWindow();
|
||||
}
|
||||
|
||||
return RiaDefines::WindowTileMode::UNDEFINED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user