From 80bc15138071fb3ff155c8ca895ab189cd97ff69 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 Sponsored-by: Virginia Tech Libraries Signed-off-by: Tomas Cohen Arazi --- 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 5fc63030206..7ccc1c4cf49 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.30.0