mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-14 01:12:11 -05:00
Guard use of nullpointer
This commit is contained in:
1 parent
2ee228c120
commit
e8f5806e55
3 files changed
+64
-43
No files matched your search
@@ -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