From bf3b43215a5345fcbf4cc2677fbb329dac298b2b Mon Sep 17 00:00:00 2001 From: Fabian Blechschmidt Date: Mon, 27 May 2024 13:21:24 +0200 Subject: [PATCH] Fixes #20 /var/www/html/src/Filters/QueryMatchFilter.php:67 Undefined array key 0 --- src/Filters/QueryMatchFilter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Filters/QueryMatchFilter.php b/src/Filters/QueryMatchFilter.php index 42ad167..8a1dfd9 100644 --- a/src/Filters/QueryMatchFilter.php +++ b/src/Filters/QueryMatchFilter.php @@ -64,7 +64,7 @@ public function filter($collection): array if (AccessHelper::keyExists($value, $key, $this->magicIsAllowed)) { $value1 = AccessHelper::getValue($value, $key, $this->magicIsAllowed); } elseif (str_contains($key, '.')) { - $value1 = (new JSONPath($value))->find($key)->getData()[0]; + $value1 = (new JSONPath($value))->find($key)->getData()[0] ?? ''; } if ($value1) { if ($operator === null && $value1) {