From 2ea147db47626a4e2ff82c4ca5b7ba92827ce36e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 22 Feb 2018 15:37:27 -0300 Subject: [PATCH] Bug 20287: Remove warning If there are no patrons in DB: Use of uninitialized value in addition (+) Signed-off-by: Josef Moravec Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- Koha/Patron.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 3d2456cc9e..1c245262ba 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -106,7 +106,7 @@ sub fixup_cardnumber { select => \'CAST(cardnumber AS SIGNED)', as => ['cast_cardnumber'] })->_resultset->get_column('cast_cardnumber')->max; - $self->cardnumber($max+1); + $self->cardnumber(($max || 0) +1); } # trim whitespace from data which has some non-whitespace in it. -- 2.39.5