From b657bc1309d582b95d7d4ffed8228d975d1cff33 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 Signed-off-by: Andrew Fuerste-Henry --- 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 5fc6303020..7ccc1c4cf4 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.11.0