@@ -, +, @@ only if issue exists t/db_dependent/SIP/Message.t t/db_dependent/Reserves.t t/db_dependent/Circulation/issue.t t/db_dependent/SIP/Transaction.t t/db_dependent/Circulation.t --- C4/Circulation.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -2206,14 +2206,16 @@ sub AddReturn { } } - my $checkin = Koha::Old::Checkouts->find($issue->id); + if ( $issue ) { + my $checkin = Koha::Old::Checkouts->find($issue->id); - Koha::Plugins->call('after_circ_action', { - action => 'checkin', - payload => { - checkout=> $checkin - } - }); + Koha::Plugins->call('after_circ_action', { + action => 'checkin', + payload => { + checkout=> $checkin + } + }); + } return ( $doreturn, $messages, $issue, ( $patron ? $patron->unblessed : {} )); } --