Improved robustness of handling preset files stored into a wrong location.

Fixes https://github.com/prusa3d/Slic3r/issues/616
This commit is contained in:
bubnikv 2017-12-09 18:48:21 +01:00
parent 8509e4b5f5
commit 9a80ff57b2

View File

@ -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<ConfigOptionVectorBase*>(opt)->resize(num_extruders, defaults.option(key));
if (opt != nullptr && opt->is_vector())
static_cast<ConfigOptionVectorBase*>(opt)->resize(num_extruders, defaults.option(key));
}
}