diff --git a/src/libslic3r/Config.hpp b/src/libslic3r/Config.hpp index 45bee05c2c..98cd75aad1 100644 --- a/src/libslic3r/Config.hpp +++ b/src/libslic3r/Config.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -2514,7 +2515,11 @@ public: TYPE* option(const t_config_option_key &opt_key, bool create = false) { ConfigOption *opt = this->optptr(opt_key, create); - return (opt == nullptr || opt->type() != TYPE::static_type()) ? nullptr : static_cast(opt); + if (opt != nullptr && opt->type() != TYPE::static_type()) { + BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << ": attempt to access option with wrong type: " << opt_key; + return nullptr; + } + return static_cast(opt); } ConfigOption* option_throw(const t_config_option_key &opt_key, bool create = false)