mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 00:52:04 +00:00
Add fallback when color was not specified (crash fix) (#13002)
This commit is contained in:
@@ -1471,7 +1471,7 @@ void GLVolumeCollection::update_colors_by_extruder(const DynamicPrintConfig *con
|
||||
using ColorItem = std::pair<std::string, ColorRGBA>;
|
||||
std::vector<ColorItem> colors;
|
||||
|
||||
if (static_cast<PrinterTechnology>(config->opt_int("printer_technology")) == ptSLA) {
|
||||
if (config->has("printer_technology") && static_cast<PrinterTechnology>(config->opt_int("printer_technology")) == ptSLA) {
|
||||
const std::string& txt_color = config->opt_string("material_colour").empty() ?
|
||||
print_config_def.get("material_colour")->get_default_value<ConfigOptionString>()->value :
|
||||
config->opt_string("material_colour");
|
||||
@@ -1480,6 +1480,9 @@ void GLVolumeCollection::update_colors_by_extruder(const DynamicPrintConfig *con
|
||||
colors.push_back({ txt_color, rgba });
|
||||
}
|
||||
else {
|
||||
if (!config->has("filament_colour")) {
|
||||
return;
|
||||
}
|
||||
const ConfigOptionStrings* filamemts_opt = dynamic_cast<const ConfigOptionStrings*>(config->option("filament_colour"));
|
||||
if (filamemts_opt == nullptr)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user