From 499c2d45dfac06827cf7486e1c66b2c49280a01f Mon Sep 17 00:00:00 2001 From: supermerill Date: Wed, 20 Oct 2021 22:06:41 +0200 Subject: [PATCH] Fix crash when layer_height is 0 supermerill/SuperSlicer#1664 --- src/libslic3r/PrintConfig.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 94864a683..223f409eb 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -6208,8 +6208,11 @@ std::set DynamicPrintConfig::update_phony(const std:: //note: width<-> spacing conversion is done via float, so max 6-7 digit of precision. std::set DynamicPrintConfig::value_changed(const t_config_option_key& opt_key, const std::vector config_collection) { - if (opt_key == "layer_height") { + const ConfigOptionFloat* layer_height_option = find_option("layer_height", this, config_collection); + //if bad layer height, slip to be able to go to the check part without outputing exceptions. + if (layer_height_option && layer_height_option->value < EPSILON) + return {}; if (!update_phony(config_collection).empty()) return { this }; return {};