From ccbd1b0071e54ce46b72b5195b2d09e62821a363 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Fri, 24 Jan 2025 16:03:42 +0530 Subject: [PATCH] check file empty --- lib/Service/DomainService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Service/DomainService.php b/lib/Service/DomainService.php index ca5f43c..eb62841 100644 --- a/lib/Service/DomainService.php +++ b/lib/Service/DomainService.php @@ -115,7 +115,9 @@ private function getDomainsFromFile(string $filename, IL10N $l): array { // Attempt to get and read the file $file = $this->getDomainsFile($filename); $content = $file->getContent(); - + if (empty($content)) { + return []; + } // Decode JSON content return json_decode($content, true, 512, JSON_THROW_ON_ERROR) ?? []; } catch (NotFoundException $e) { -- GitLab