Fix/fixed unicode preset name issue (#13458)

* fixed an issue for unicode preset name
This commit is contained in:
SoftFever
2026-05-03 15:42:45 +08:00
committed by GitHub
parent 6fd4984cad
commit 66b3d5e263
2 changed files with 7 additions and 7 deletions

View File

@@ -6808,10 +6808,10 @@ wxSizer* Tab::compatible_widget_create(wxWindow* parent, PresetDependencies &dep
// Collect and set indices of depending_presets marked as compatible.
wxArrayInt selections;
auto *compatible_printers = dynamic_cast<const ConfigOptionStrings*>(m_config->option(deps.key_list));
if (compatible_printers != nullptr || !compatible_printers->values.empty())
if (compatible_printers != nullptr && !compatible_printers->values.empty())
for (auto preset_name : compatible_printers->values)
for (size_t idx = 0; idx < presets.GetCount(); ++idx)
if (presets[idx] == preset_name) {
if (presets[idx] == from_u8(preset_name)) {
selections.Add(idx);
break;
}