From bf8139f8a70fbac9f270020a99e692c439d4348b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 30 Aug 2019 15:01:10 +0200 Subject: [PATCH] SL::DB::Unit: Warnungen wegen nicht initialisierten Werten vermeiden Durch Tests getriggert, konkret: durch t/wh/transfer.t --- SL/DB/Unit.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SL/DB/Unit.pm b/SL/DB/Unit.pm index f5f1bc14c..508aa7477 100644 --- a/SL/DB/Unit.pm +++ b/SL/DB/Unit.pm @@ -57,7 +57,7 @@ sub convert_to { my $my_base_factor = $self->base_factor || 1; my $other_base_factor = $other_unit->base_factor || 1; - return $qty * $my_base_factor / $other_base_factor; + return ($qty // 0) * $my_base_factor / $other_base_factor; } sub is_time_based { -- 2.20.1