From bead002044b9093a2dc8483c700ff5ae91a2d2a8 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 2 Feb 2021 16:39:40 -0300 Subject: [PATCH] Bug 26636: (QA follow-up) Handle no results correctly [20.11.x] Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Tomas Cohen Arazi Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Martin Renvoize --- Koha/REST/Plugin/Objects.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Koha/REST/Plugin/Objects.pm b/Koha/REST/Plugin/Objects.pm index 02d4bd01da..aa6eb16997 100644 --- a/Koha/REST/Plugin/Objects.pm +++ b/Koha/REST/Plugin/Objects.pm @@ -64,6 +64,8 @@ the requested object. It passes through any embeds if specified. my $object = $result_set->find( $id, $attributes ); + return unless $object; + return $object->to_api({ embed => $embed }); } ); -- 2.33.1