diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index aa5e16b8ba..831d6fa52d 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -242,14 +242,17 @@ sub logs { my $patron = $request->patron; -Returns the linked I object. +For a given request, return the linked I object +associated with it, or undef if none exists =cut sub patron { my ( $self ) = @_; - return Koha::Patron->_new_from_dbic( scalar $self->_result->patron ); + my $patron_rs = $self->_result->patron; + return unless $patron_rs; + return Koha::Patron->_new_from_dbic($patron_rs); } =head3 library