Prevent crash when changing number of extruders

This commit is contained in:
Alessandro Ranellucci 2014-03-25 19:21:44 +01:00
parent d1bb69434e
commit 2e6213fea6

View File

@ -738,7 +738,7 @@ sub config {
# remove all unused values
foreach my $opt_key ($self->_extruder_options) {
my $values = $config->get($opt_key);
splice @$values, $self->{extruders_count};
splice @$values, $self->{extruders_count} if $self->{extruders_count} <= $#$values;
$config->set($opt_key, $values);
}