From 3b3b5278a18f0f3432c0a37950b1da2ada8bff48 Mon Sep 17 00:00:00 2001 From: hexpande Date: Wed, 17 Mar 2021 11:49:10 +0300 Subject: [PATCH] Results can be null In the current situation it will error because of a reference to an array index on null. This fixes this issue. --- src/Engines/TNTSearchEngine.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Engines/TNTSearchEngine.php b/src/Engines/TNTSearchEngine.php index 5e26401..e751569 100644 --- a/src/Engines/TNTSearchEngine.php +++ b/src/Engines/TNTSearchEngine.php @@ -252,6 +252,10 @@ public function getBuilder($model) */ public function mapIds($results) { + if (empty($results['ids'])) { + return collect(); + } + return collect($results['ids'])->values(); }