FIX: crash at flow rate cali save when input Chinese

Change-Id: Idfc913e79c13646c9536c8d331c216acdb1e2ef5
(cherry picked from commit cd68769b8fae92d2026ea91e5c32afaf6fb85b76)
This commit is contained in:
liz.li 2023-08-07 09:48:06 +08:00 committed by lane.wei
parent 74fe72b2c9
commit 22171e6534

View file

@ -961,7 +961,7 @@ void FlowRateWizard::on_cali_save()
std::map<std::string, ConfigOption*> key_value_map;
key_value_map.insert(std::make_pair("filament_flow_ratio", new ConfigOptionFloats{ new_results[i].second }));
std::string message;
if (!save_preset(old_preset_name, new_results[i].first.ToStdString(), key_value_map, message)) {
if (!save_preset(old_preset_name, into_u8(new_results[i].first), key_value_map, message)) {
MessageDialog error_msg_dlg(nullptr, message, wxEmptyString, wxICON_WARNING | wxOK);
error_msg_dlg.ShowModal();
return;