Fix crash when switching profiles

This commit is contained in:
Noisyfox 2025-10-02 23:00:19 +08:00
parent a932821168
commit addc718acf

View file

@ -792,7 +792,7 @@ struct DynamicFilamentList : DynamicList
std::string type;
wxGetApp().preset_bundle->filaments.find_preset(presets[i])->get_filament_type(type);
str << type;
items.push_back({str, icons[i]});
items.push_back({str, i < icons.size() ? icons[i] : nullptr});
}
DynamicList::update();
}
@ -839,7 +839,7 @@ struct DynamicFilamentList1Based : DynamicFilamentList
std::string type;
wxGetApp().preset_bundle->filaments.find_preset(presets[i])->get_filament_type(type);
str << type;
items.push_back({str, icons[i]});
items.push_back({str, i < icons.size() ? icons[i] : nullptr});
}
DynamicList::update();
}