Bug 20287: Remove warning

If there are no patrons in DB:
Use of uninitialized value  in addition (+)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2018-02-22 15:37:27 -03:00 committed by Nick Clemens
parent b4d9be74fc
commit 2ea147db47

View file

@ -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.