From: erickson Date: Mon, 14 Mar 2011 17:42:20 +0000 (+0000) Subject: exit gen_fines_stop early if there is nothing to do; prevents (unneeded) secondary... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8745f457ae26b4f087b833070e28c2bc86d4800e;p=evergreen%2Fequinox.git exit gen_fines_stop early if there is nothing to do; prevents (unneeded) secondary call to ->wait_complete on potentially undef reference git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@19740 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm index 558be16efa..11468ef78a 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -2951,13 +2951,13 @@ sub generate_fines_finish { my $self = shift; my $reservation = shift; - $self->{_gen_fines_req}->wait_complete if ($self->{_gen_fines_req}); - - my $id = $reservation ? $self->reservation->id : $self->circ->id; + return undef unless $self->{_gen_fines_req}; $self->{_gen_fines_req}->wait_complete; delete($self->{_gen_fines_req}); + my $id = $reservation ? $self->reservation->id : $self->circ->id; + # refresh the circ in case the fine generator set the stop_fines field $self->reservation($self->editor->retrieve_booking_reservation($id)) if $reservation; $self->circ($self->editor->retrieve_action_circulation($id)) if !$reservation;