Skip to content

Commit

Permalink
warning when using a scripted widget without code, instead of crashing.
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Aug 11, 2022
1 parent c3816fa commit 99644f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/slic3r/GUI/OptionsGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,12 @@ void OptionsGroup::update_script_presets() {
if (key_opt.second.opt.is_script) {
Field* field = get_field(key_opt.first);
if (field) {
this->set_value(key_opt.first, key_opt.second.script->call_script_function_get_value(key_opt.second.opt));
boost::any val = key_opt.second.script->call_script_function_get_value(key_opt.second.opt);
if (val.empty()) {
MessageDialog(nullptr, "Error, can't find the script to get the value for the widget '" + key_opt.first + "'", _L("Error"), wxOK | wxICON_ERROR).ShowModal();
} else {
this->set_value(key_opt.first, val);
}
} //if not, it will set at ConfigOptionsGroup::reload_config()
}
}
Expand Down

0 comments on commit 99644f0

Please sign in to comment.