Guard null pointer use

This commit is contained in:
Magne Sjaastad 2023-11-13 15:54:55 +01:00
parent 48c6517305
commit d3a1c80edf

View File

@ -354,11 +354,12 @@ bool RiuMainWindowBase::isBlockingViewSelectionOnSubWindowActivated() const
void RiuMainWindowBase::removeViewerFromMdiArea( RiuMdiArea* mdiArea, QWidget* viewer ) void RiuMainWindowBase::removeViewerFromMdiArea( RiuMdiArea* mdiArea, QWidget* viewer )
{ {
bool removedSubWindowWasActive = false; bool removedSubWindowWasActive = false;
bool wasMaximized = true;
QMdiSubWindow* subWindowBeingClosed = findMdiSubWindow( viewer ); if ( QMdiSubWindow* subWindowBeingClosed = findMdiSubWindow( viewer ) )
bool wasMaximized = subWindowBeingClosed->isMaximized();
if ( subWindowBeingClosed )
{ {
wasMaximized = subWindowBeingClosed->isMaximized();
if ( subWindowBeingClosed->isActiveWindow() ) if ( subWindowBeingClosed->isActiveWindow() )
{ {
// If we are removing the active window, we will need a new active window // If we are removing the active window, we will need a new active window