Qt: Fix crash opening game settings

This commit is contained in:
Connor McLaughlin
2022-07-23 01:49:53 +10:00
parent 7c2f335228
commit 0ba623b392
3 changed files with 8 additions and 2 deletions

View File

@@ -181,7 +181,7 @@ struct SettingAccessor<QComboBox>
}
static void setNullableStringValue(QComboBox* widget, std::optional<QString> value)
{
isNullValue(widget) ? widget->setCurrentIndex(0) : setStringValue(widget, value.value());
value.has_value() ? setStringValue(widget, value.value()) : widget->setCurrentIndex(0);
}
template<typename F>