Bug 41267: (follow-up) Check if exists

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9539b21089)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This commit is contained in:
Lucas Gass 2026-04-09 20:08:35 +00:00 committed by Jacob O'Mara
parent 76e69eb566
commit 3a6f0e55e1
No known key found for this signature in database
1 changed files with 6 additions and 4 deletions

View File

@ -2277,10 +2277,12 @@ sub MoveReserve {
if ( $cancelreserve && $res ) {
$hold = Koha::Holds->find( $res->{reserve_id} );
if ( $cancelreserve eq 'revert' ) {
$hold->revert_found();
} else { # cancel reserves on this item
$hold->cancel;
if ($hold) {
if ( $cancelreserve eq 'revert' ) {
$hold->revert_found();
} else { # cancel reserves on this item
$hold->cancel;
}
}
}
}