mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-01 01:12:59 -05:00
Fix crash when syncing filaments after a plate is deleted (#17042)
The sync dialog is reused between syncs, and its plate index is left over from the last one. If that plate no longer exists, because it was deleted or a project with fewer plates was loaded, the next sync read the thumbnail of a null plate and crashed. reinit_dialog() now falls back to the current plate when the index is out of range.
This commit is contained in:
1 parent
0b041740b1
commit
70bc685101
1 file changed
+6
@@ -1144,6 +1144,12 @@ void SyncAmsInfoDialog::reinit_dialog()
|
||||
m_ams_mapping_result.clear();
|
||||
m_preview_colors_in_thumbnail.clear();
|
||||
|
||||
// The dialog is reused across syncs, so the plate picked last time may no longer exist
|
||||
// (plates deleted or another project loaded). update_show_status() reads its thumbnail.
|
||||
PartPlateList &plate_list = wxGetApp().plater()->get_partplate_list();
|
||||
if (m_specify_plate_idx < 0 || m_specify_plate_idx >= plate_list.get_plate_count())
|
||||
m_specify_plate_idx = plate_list.get_curr_plate_index();
|
||||
|
||||
show_status(PrintDialogStatus::PrintStatusInit);
|
||||
update_show_status();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user