From 604eee1ba787f21962563882cf9c151343bc301b Mon Sep 17 00:00:00 2001 From: Richard Dern Date: Mon, 22 Apr 2024 21:51:50 +0200 Subject: [PATCH] Fix: No need to format an empty string --- app/Services/Markdown/Formatter.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Services/Markdown/Formatter.php b/app/Services/Markdown/Formatter.php index 5b75689..415da41 100644 --- a/app/Services/Markdown/Formatter.php +++ b/app/Services/Markdown/Formatter.php @@ -43,6 +43,10 @@ public function __construct(protected string $source) */ public function render(): string { + if (empty($this->source)) { + return $this->source; + } + $hash = md5($this->source); $cacheKey = sprintf('markdown_formatted_%s', $hash);