FIX:fixed crashes when printer resources cannot be found

jira:[none]

Change-Id: I8866d067a177afcb5c0341b65d8999dc063cb7e3
(cherry picked from commit 0fe8675141c02c9c09e104b848318f42e126bd4a)
This commit is contained in:
tao wang
2024-12-27 12:04:17 +08:00
committed by Noisyfox
parent da0adbf498
commit 7235893726

View File

@@ -2928,7 +2928,12 @@ void SelectMachineDialog::on_selection_changed(wxCommandEvent &event)
// update image
auto printer_img_name = "printer_preview_" + obj->printer_type;
m_printer_image->SetBitmap(create_scaled_bitmap(printer_img_name, this, 52));
try {
m_printer_image->SetBitmap(create_scaled_bitmap(printer_img_name, this, 52));
} catch (const std::exception &) {
m_printer_image->SetBitmap(create_scaled_bitmap("printer_preview_BL-P001", this, 52));
}
obj->command_get_version();
obj->command_request_push_all();