From bd0ebce71a7308905da91d84da7e7e29bc65bc88 Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Wed, 18 Jan 2023 03:28:22 +0100 Subject: [PATCH] Fix undef warning --- plugins/statiegeld_tokens | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/statiegeld_tokens b/plugins/statiegeld_tokens index 0cd3bc7..55ad659 100644 --- a/plugins/statiegeld_tokens +++ b/plugins/statiegeld_tokens @@ -147,7 +147,7 @@ sub hook_checkout_prepare($class, $cart, $username, $transaction_id, @) { for my $id (keys %warnings_by_id) { my $products = RevBank::Plugin::products::read_products(); my $addon = $products->{"+$id"} // $products->{$id}; - my $avail = $had_num_tokens_by_id{$id}; + my $avail = $had_num_tokens_by_id{$id} // 0; my $only = + $avail == 0 ? "0 deposit tokens" : $avail == 1 ? "only 1 deposit token"