From b23dbd65f0114b9d785691a97b2194650843ea50 Mon Sep 17 00:00:00 2001 From: jonjenssen Date: Thu, 15 Sep 2022 13:54:39 +0200 Subject: [PATCH] Fix crash if only plot window is open and you change i.e. the font size in preferences --- ApplicationLibCode/Application/RiaGuiApplication.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/Application/RiaGuiApplication.cpp b/ApplicationLibCode/Application/RiaGuiApplication.cpp index 3b4ac39bfa..e59d50d51b 100644 --- a/ApplicationLibCode/Application/RiaGuiApplication.cpp +++ b/ApplicationLibCode/Application/RiaGuiApplication.cpp @@ -1437,7 +1437,7 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences* } QMessageBox::StandardButton reply; - reply = QMessageBox::question( m_mainWindow, + reply = QMessageBox::question( activeMainWindow(), QString( "Apply %1 to Existing Views or Plots?" ).arg( listString ), QString( "You have changed default %1 and have existing views or plots with " "different settings.\n" ) @@ -1502,7 +1502,10 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences* if ( oldPreferences->defaultPlotFontSize() != m_preferences->defaultPlotFontSize() ) { - m_mainWindow->applyFontSizesToDockedPlots(); + if ( m_mainWindow ) + { + m_mainWindow->applyFontSizesToDockedPlots(); + } } if ( oldPreferences->defaultPageLayout() != m_preferences->defaultPageLayout() )