From 0e2710d164cc7d7676c98377e6e13900b24f7556 Mon Sep 17 00:00:00 2001 From: Florian Meyer Date: Thu, 18 Jan 2018 17:52:32 +0100 Subject: [PATCH] Fixed error on empty content field --- Model/KnpResultSet.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Model/KnpResultSet.php b/Model/KnpResultSet.php index 63d6e1f..035d4e4 100644 --- a/Model/KnpResultSet.php +++ b/Model/KnpResultSet.php @@ -74,6 +74,7 @@ public function getResults($offset = 0, $limit = null) { public function getExcerpt(BaseDocument $document) { $content = $document->getFieldValue(BaseDocument::FIELD_CONTENT); $content = !is_array($content) ? $content : implode(' ', $content); + if($content === null) return null; return Utils::highlight(Utils::excerpt($content, $this->term), $this->term); } } \ No newline at end of file