Fixed issues with undefined filament color preview values.

This commit is contained in:
bubnikv 2017-07-20 13:02:12 +02:00
parent 6bb773d0dd
commit afd5d9eff3

View File

@ -251,8 +251,8 @@ sub load_print {
my @filament_colors = @{$self->{config}->filament_colour};
for (my $i = 0; $i <= $#extruder_colors; $i += 1) {
my $color = $extruder_colors[$i];
$color = $filament_colors[$i] if ($color !~ m/^#[[:xdigit:]]{6}/);
$color = '#FFFFFF' if ($color !~ m/^#[[:xdigit:]]{6}/);
$color = $filament_colors[$i] if (! defined($color) || $color !~ m/^#[[:xdigit:]]{6}/);
$color = '#FFFFFF' if (! defined($color) || $color !~ m/^#[[:xdigit:]]{6}/);
push @colors, $color;
}
}