LP#2004420: check that $note is defined before using it
authorChris Sharp <csharp@georgialibraries.org>
Tue, 31 Jan 2023 19:59:18 +0000 (14:59 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Tue, 31 Jan 2023 20:00:47 +0000 (15:00 -0500)
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm

index c72072c..3d1f9ab 100644 (file)
@@ -949,9 +949,10 @@ sub void_bills {
         $bill->voided('t');
         $bill->voider($e->requestor->id);
         $bill->void_time('now');
-        my $n = ($bill->note) ? sprintf("%s\n", $bill->note) : "";
-        $bill->note(sprintf("$n%s", $note));
-
+        if ($note) { # only do this if there's a $note to add
+            my $n = ($bill->note) ? sprintf("%s\n", $bill->note) : "";
+            $bill->note(sprintf("$n%s", $note));
+        }
         $e->update_money_billing($bill) or return $e->die_event;
         my $evt = $U->check_open_xact($e, $bill->xact, $xact);
         return $evt if $evt;