Fix crash on Preferences dialog close

Mitigation for regression introduced by
74ac09346f.

On finish() method call m_widget maybe nullptr, so call for any him
methods is dangerous without checking for nullptr.

Change-Id: Ia7ab5572946fef9bcc62c63709e5ffc69cd2ebae
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
This commit is contained in:
Alexander Drozdov
2022-08-17 15:03:52 +10:00
parent 26e47cb6ce
commit 4a79623959

View File

@@ -439,7 +439,8 @@ void CppCodeStyleSettingsPage::apply()
void CppCodeStyleSettingsPage::finish()
{
m_widget->finish();
if (m_widget)
m_widget->finish();
delete m_widget;
}