Don't die when addon doesn't exist
This commit is contained in:
parent
19cf432905
commit
02c9db1ddf
1 changed files with 2 additions and 1 deletions
|
@ -133,11 +133,12 @@ sub read_products($filename = "revbank.products", $default_contra = "+sales/prod
|
||||||
next PRODUCT;
|
next PRODUCT;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $addon = { %{ $products{$addon_id} } }; # shallow copy to overwrite ->{price} later
|
my $addon = $products{$addon_id};
|
||||||
if (not $addon) {
|
if (not $addon) {
|
||||||
warn "Addon '$addon_id' does not exist for '$product->{id}' at $filename line $product->{line}.\n";
|
warn "Addon '$addon_id' does not exist for '$product->{id}' at $filename line $product->{line}.\n";
|
||||||
next PRODUCT;
|
next PRODUCT;
|
||||||
}
|
}
|
||||||
|
$addon = { %$addon }; # shallow copy to overwrite ->{price} later
|
||||||
|
|
||||||
push @{ $product->{addons} }, $addon;
|
push @{ $product->{addons} }, $addon;
|
||||||
push @addon_ids, @{ $addon->{_addon_ids} };
|
push @addon_ids, @{ $addon->{_addon_ids} };
|
||||||
|
|
Loading…
Add table
Reference in a new issue