From bd02174f40a4d6640400bc5750344c7d36280934 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Sun, 14 Jan 2018 21:52:55 +0100 Subject: [PATCH] Fixed a bug in "on_change_OG" --- xs/src/slic3r/GUI/OptionsGroup.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/xs/src/slic3r/GUI/OptionsGroup.cpp b/xs/src/slic3r/GUI/OptionsGroup.cpp index 3399ec02d..21704453c 100644 --- a/xs/src/slic3r/GUI/OptionsGroup.cpp +++ b/xs/src/slic3r/GUI/OptionsGroup.cpp @@ -214,8 +214,17 @@ void ConfigOptionsGroup::on_change_OG(t_config_option_key opt_id, boost::any val { if (!m_opt_map.empty()) { - std::string opt_key = m_opt_map.at(opt_id).first; - int opt_index = m_opt_map.at(opt_id).second; + auto it = m_opt_map.find(opt_id); + if (it == m_opt_map.end()) + { + OptionsGroup::on_change_OG(opt_id, value); + return; + } + + auto itOption = it->second; + std::string opt_key = itOption.first; + int opt_index = itOption.second; + auto option = m_options.at(opt_id); // get value