From 9a80ff57b26b41bf1e4ad275ccd8416cd0d567b0 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Sat, 9 Dec 2017 18:48:21 +0100 Subject: [PATCH] Improved robustness of handling preset files stored into a wrong location. Fixes https://github.com/prusa3d/Slic3r/issues/616 --- xs/src/slic3r/GUI/Preset.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xs/src/slic3r/GUI/Preset.cpp b/xs/src/slic3r/GUI/Preset.cpp index 4b21b18a00..8ba3029ba1 100644 --- a/xs/src/slic3r/GUI/Preset.cpp +++ b/xs/src/slic3r/GUI/Preset.cpp @@ -79,7 +79,8 @@ void Preset::set_num_extruders(DynamicPrintConfig &config, unsigned int num_extr auto *opt = config.option(key, false); assert(opt != nullptr); assert(opt->is_vector()); - static_cast(opt)->resize(num_extruders, defaults.option(key)); + if (opt != nullptr && opt->is_vector()) + static_cast(opt)->resize(num_extruders, defaults.option(key)); } }