Add further hold-not-found checks
authorJeff Godin <jgodin@tadl.org>
Fri, 11 Oct 2013 14:25:05 +0000 (10:25 -0400)
committerJeff Godin <jgodin@tadl.org>
Tue, 5 Nov 2013 14:26:40 +0000 (09:26 -0500)
Add checks for hold-not-found in update_hold_pickup subroutine to
prevent failure from trying to call pickup_lib on an undef value.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
iNCIPit.cgi

index 7086825..d2905cd 100644 (file)
@@ -1672,6 +1672,9 @@ sub update_hold_pickup {
 
     my $hold = find_hold_on_copy($copy_barcode);
 
+    # return if hold was not found
+    return undef unless defined($hold) && blessed($hold);
+
     $hold->pickup_lib($pickup_lib);
 
     # update the copy hold with the new pickup lib information