mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 18:58:00 -06:00
Gracefully handle loading config files having empty strings for multi-value options (like wipe). #2003
This commit is contained in:
parent
85b0a4376a
commit
a8b6e32767
2 changed files with 6 additions and 2 deletions
|
@ -231,7 +231,9 @@ sub _build_field {
|
|||
});
|
||||
} else {
|
||||
$field = Wx::TextCtrl->new($self->parent, -1, $opt->{default}, wxDefaultPosition, $size, $style);
|
||||
$self->_setters->{$opt_key} = sub { $field->ChangeValue($_[0]) };
|
||||
# value supplied to the setter callback might be undef in case user loads a config
|
||||
# that has empty string for multi-value options like 'wipe'
|
||||
$self->_setters->{$opt_key} = sub { $field->ChangeValue($_[0]) if defined $_[0] };
|
||||
EVT_TEXT($self->parent, $field, $on_change);
|
||||
EVT_KILL_FOCUS($field, $on_kill_focus);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue