Bug 19080: Handle non-existing patrons gratefully
[koha.git] / members / pay.pl
index e4d0a95..7c3f6ad 100755 (executable)
@@ -68,6 +68,10 @@ if ( !$borrowernumber ) {
 
 # get borrower details
 my $patron = Koha::Patrons->find( $borrowernumber );
+unless ( $patron ) {
+    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
+    exit;
+}
 my $category = $patron->category;
 our $borrower = $patron->unblessed;
 $borrower->{description} = $category->description;