for my $i ( 2 .. $number_of_parts ) {
my $part = $parts[0]->clone_and_reset;
- $part->partnumber( $part->partnumber . " " . $i );
- $part->description( $part->description . " " . $i );
+ $part->partnumber( ($part->partnumber // '') . " " . $i );
+ $part->description( ($part->description // '') . " " . $i );
$part->save;
push(@parts, $part);
}
for my $i ( 2 .. $number_of_parts ) {
my $part = $parts[0]->clone_and_reset;
- $part->partnumber( $part->partnumber . " " . $i );
- $part->description( $part->description . " " . $i );
+ $part->partnumber( ($part->partnumber // '') . " " . $i );
+ $part->description( ($part->description // '') . " " . $i );
$part->save;
push(@parts, $part);
}