From d866d097a7193f3c80ca0ff9a230f8171631526b Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Sat, 16 Jan 2021 16:30:27 +0000 Subject: [PATCH] Bug 22544: Fix NewsItem::author --- Koha/NewsItem.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/NewsItem.pm b/Koha/NewsItem.pm index aa694f4132..16b6ad0e7e 100644 --- a/Koha/NewsItem.pm +++ b/Koha/NewsItem.pm @@ -50,7 +50,9 @@ Return the Koha::Patron object for the patron who authored this news item sub author { my ( $self ) = @_; - return Koha::Patron->_new_from_dbic($self->_result->borrowernumber); + my $author_rs = $self->_result->borrowernumber; + return unless $author_rs; + return Koha::Patron->_new_from_dbic( $author_rs ); } =head3 is_expired -- 2.11.0