mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-01 21:01:12 +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:
+2
-1
@@ -1913,7 +1913,8 @@ int CLI::run(int argc, char **argv)
|
||||
old_printable_width = static_cast<int>(old_printable_bbox.size().x());
|
||||
old_printable_depth = static_cast<int>(old_printable_bbox.size().y());
|
||||
}
|
||||
old_printable_height = (int)(config.opt_float("printable_height"));
|
||||
if (config.option<ConfigOptionFloat>("printable_height"))
|
||||
old_printable_height = (int)(config.opt_float("printable_height"));
|
||||
|
||||
if (config.option<ConfigOptionFloat>("extruder_clearance_height_to_rod"))
|
||||
old_height_to_rod = config.opt_float("extruder_clearance_height_to_rod");
|
||||
|
||||
Reference in New Issue
Block a user