From 5adc4b7261dc1b748f4d988798c6cc0719d4455e Mon Sep 17 00:00:00 2001 From: Thierry Dallacroce Date: Tue, 21 Dec 2021 07:18:46 -0800 Subject: [PATCH] The first element may not have index zero (#3680) --- modules/metastore/src/Service.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/metastore/src/Service.php b/modules/metastore/src/Service.php index 4732c1a732..f8dfbaf77d 100644 --- a/modules/metastore/src/Service.php +++ b/modules/metastore/src/Service.php @@ -165,7 +165,7 @@ public function getAll($schema_id): array { if (count($data) == 0) { return TRUE; } - return $data[0] instanceof RootedJsonData; + return reset($data) instanceof RootedJsonData; }); } @@ -194,7 +194,7 @@ public function getRange(string $schema_id, int $start, int $length):array { if (count($data) == 0) { return TRUE; } - return $data[0] instanceof RootedJsonData; + return reset($data) instanceof RootedJsonData; }); }