mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-02 05:11:00 +00:00
Fix CLI crash on a 3mf without project settings (#16004)
When a 3mf is tagged as written by OrcaSlicer or BambuStudio, the CLI treats it as a project and reads the printer settings stored in the file. #14580 guarded four of those reads, but printable_height still called opt_float() without a check, so a 3mf whose project_settings.config is empty or missing crashed with a null dereference. The handy models OrcaBadge.3mf and OrcaSliced.3mf are both like this. Skip the read when the option is absent, like the reads around it. The bed-size logic further down already treats an old printable height of 0 as unknown and uses the current printer's.
This commit is contained in:
@@ -1913,6 +1913,7 @@ int CLI::run(int argc, char **argv)
|
|||||||
old_printable_width = static_cast<int>(old_printable_bbox.size().x());
|
old_printable_width = static_cast<int>(old_printable_bbox.size().x());
|
||||||
old_printable_depth = static_cast<int>(old_printable_bbox.size().y());
|
old_printable_depth = static_cast<int>(old_printable_bbox.size().y());
|
||||||
}
|
}
|
||||||
|
if (config.option<ConfigOptionFloat>("printable_height"))
|
||||||
old_printable_height = (int)(config.opt_float("printable_height"));
|
old_printable_height = (int)(config.opt_float("printable_height"));
|
||||||
|
|
||||||
if (config.option<ConfigOptionFloat>("extruder_clearance_height_to_rod"))
|
if (config.option<ConfigOptionFloat>("extruder_clearance_height_to_rod"))
|
||||||
|
|||||||
Reference in New Issue
Block a user