FIX:fixed crashes when printer resources cannot be found

jira:[none]

Change-Id: I8866d067a177afcb5c0341b65d8999dc063cb7e3
This commit is contained in:
tao wang 2024-12-27 12:04:17 +08:00 committed by lane.wei
parent e02482bcce
commit 0fe8675141
1 changed files with 6 additions and 1 deletions

View File

@ -2984,7 +2984,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();