From 69aad853ee23d2fa679fbc7f558cbe3853b7ed06 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 4 Feb 2021 18:14:15 +0000 Subject: [PATCH] Handle empty values for API output --- include/api.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/api.php b/include/api.php index e6d62c57a..2da72f8d2 100644 --- a/include/api.php +++ b/include/api.php @@ -2931,6 +2931,10 @@ function api_format_items($items, $user_info, $filter_user = false, $type = "jso $ret = []; + if (empty($items)) { + return $ret; + } + foreach ((array)$items as $item) { list($status_user, $author_user, $owner_user) = api_item_get_user($a, $item);