[open-ils-commits] r19740 - branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Mar 14 13:42:23 EDT 2011


Author: erickson
Date: 2011-03-14 13:42:20 -0400 (Mon, 14 Mar 2011)
New Revision: 19740

Modified:
   branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
Log:
exit gen_fines_stop early if there is nothing to do; prevents (unneeded) secondary call to ->wait_complete on potentially undef reference

Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm	2011-03-14 16:35:23 UTC (rev 19739)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm	2011-03-14 17:42:20 UTC (rev 19740)
@@ -2951,13 +2951,13 @@
    my $self = shift;
    my $reservation = shift;
 
-   $self->{_gen_fines_req}->wait_complete if ($self->{_gen_fines_req});
+   return undef unless $self->{_gen_fines_req};
 
-   my $id = $reservation ? $self->reservation->id : $self->circ->id;
-
    $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;



More information about the open-ils-commits mailing list