From 4a65fe61f482a08932a5d210df1ec0c59dd7771e 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 Polytechnic Institute and State University Signed-off-by: Tomas Cohen Arazi Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- 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.39.5