From 5a1e5450fc1dba1afc14fc04d5cb8315a05f700e Mon Sep 17 00:00:00 2001 From: Konrad Michalik Date: Thu, 13 Feb 2025 08:59:46 +0100 Subject: [PATCH] fix: prevent empty cache entries --- Classes/Domain/Repository/RecordRepository.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Classes/Domain/Repository/RecordRepository.php b/Classes/Domain/Repository/RecordRepository.php index f419736..8c163ca 100644 --- a/Classes/Domain/Repository/RecordRepository.php +++ b/Classes/Domain/Repository/RecordRepository.php @@ -107,7 +107,10 @@ public function findByPid(string $table, ?int $pid = null, bool $orderByTstamp = $result = $query->executeQuery() ->fetchAllAssociative(); - $this->cache->set($cacheIdentifier, $result, $this->collectCacheTags($table, $result)); + if (!empty($result)) { + $this->cache->set($cacheIdentifier, $result, $this->collectCacheTags($table, $result)); + } + return $result; }