Bug 28644: Fix calling borrowernumber on undefined value
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thu, 1 Jul 2021 14:13:05 +0000 (14:13 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 12 Jul 2021 09:58:35 +0000 (11:58 +0200)
commita8736a1a982ff139090d02cde9c045a0d4c8839e
tree3a5889bb930f781f778db53ade89a80a785f061b
parentb8ab792dc439d84efdba84d58da4eec6b23adf9e
Bug 28644: Fix calling borrowernumber on undefined value

If the hold is not found (e.g. already cancelled), we should
return earlier without crashing:
    Can't call method "borrowernumber" on an undefined value at /usr/share/koha/C4/Reserves.pm line 521
    (Note: line number from 19.11)

Test plan:
Run t/db_dependent/Reserves.t
Add a hold, go to user menu with holds in OPAC.
At the same time, cancel this hold from staff.
Now click the Cancel in OPAC.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Reserves.pm
t/db_dependent/Reserves.t