From 482694337d16949df52f8c65be442664cd00134e Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 24 Mar 2015 11:32:16 +0100 Subject: [PATCH] Bug 13799: Fix Koha::Objects::find when no results are found If we pass undef to Koha::Object::_new_from_dbic, it croaks with message "DBIC result type isn't of the type Borrower at Koha/Objects.pm" (in case we're using Koha::Borrowers->find) --- Koha/Objects.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Koha/Objects.pm b/Koha/Objects.pm index f56764a..cd85947 100644 --- a/Koha/Objects.pm +++ b/Koha/Objects.pm @@ -83,6 +83,7 @@ sub find { return unless $id; my $result = $self->_resultset()->find($id); + return unless $result; my $object = $self->object_class()->_new_from_dbic( $result ); -- 1.9.1