FIX: fix crash when not find preset

jira: none
Change-Id: I2752294bd0cd0b063c1b164f2f14e96e54f9d9aa
(cherry picked from commit b85205f1de76e89e6400e5ecf9e5bfbbe38e6510)
This commit is contained in:
zhimin.zeng 2024-12-11 11:20:15 +08:00 committed by lane.wei
parent 7cc564fcc9
commit cb435671d0
1 changed files with 2 additions and 0 deletions

View File

@ -417,6 +417,8 @@ void PresetComboBox::add_connected_printers(std::string selected, bool alias_nam
m_first_printer_idx = GetCount();
for (auto iter = machine_list.begin(); iter != machine_list.end(); ++iter) {
Preset* printer_preset = get_printer_preset(iter->second);
if (!printer_preset)
continue;
printer_preset->is_visible = true;
int item_id = Append(from_u8(iter->second->dev_name), wxNullBitmap, &m_first_printer_idx + std::distance(machine_list.begin(), iter));
}