forked from qt-creator/qt-creator
Core: fix rare crash in GeneralSettingsWidget::apply()
The codec box might not contain any items
maybe the list failed to populate
found in https://the-qt-company-00.sentry.io/issues/6367744991
Change-Id: I46acf97749d148edc45bd33d31815d7f7e96942b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
(cherry picked from commit 2c8ff3da47
)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
@@ -295,6 +295,7 @@ void GeneralSettingsWidget::apply()
|
|||||||
setDpiPolicy(selectedPolicy);
|
setDpiPolicy(selectedPolicy);
|
||||||
}
|
}
|
||||||
currentIndex = m_codecBox->currentIndex();
|
currentIndex = m_codecBox->currentIndex();
|
||||||
|
if (currentIndex != -1)
|
||||||
setCodecForLocale(m_codecBox->itemText(currentIndex).toLocal8Bit());
|
setCodecForLocale(m_codecBox->itemText(currentIndex).toLocal8Bit());
|
||||||
// Apply the new base color if accepted
|
// Apply the new base color if accepted
|
||||||
StyleHelper::setBaseColor(m_colorButton->color());
|
StyleHelper::setBaseColor(m_colorButton->color());
|
||||||
|
Reference in New Issue
Block a user