From 6ed71a8cb96fe6c7692893459913460ff4df5697 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 17 Oct 2018 23:20:10 +0100 Subject: [PATCH] Correctly handle undefined units --- blocks/ORB/View.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blocks/ORB/View.pm b/blocks/ORB/View.pm index ac5fc57..0fea3cb 100644 --- a/blocks/ORB/View.pm +++ b/blocks/ORB/View.pm @@ -36,7 +36,7 @@ sub _resolve_recipe_name { return $rid if($rid =~ /^\d+$/); - + # TODO: actually search (use a slug search?) } @@ -58,7 +58,7 @@ sub _generate_ingredients { "%(separator)s" => $ingred -> {"separator"} })); } else { - my $units = $ingred -> {"units"} eq "None" ? "" : $ingred -> {"units"}; + my $units = (($ingred -> {"units"} // "None") eq "None") ? "" : $ingred -> {"units"}; my $quantity = $ingred -> {"quantity"} ? $ingred -> {"quantity"} : ""; push(@result, $self -> {"template"} -> load_template("view/ingredient.tem",