From a3d95b47435ddd3b8eb69fea9b0e79e36d5ad8e0 Mon Sep 17 00:00:00 2001 From: Richard Dern Date: Mon, 22 Apr 2024 21:46:55 +0200 Subject: [PATCH] Fix: Do not lint if there is no content --- app/Classes/MarkdownManager.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Classes/MarkdownManager.php b/app/Classes/MarkdownManager.php index 091ffdb..6b90a71 100644 --- a/app/Classes/MarkdownManager.php +++ b/app/Classes/MarkdownManager.php @@ -93,11 +93,13 @@ public function isDirty(): bool */ public function lint(): void { - $linter = new Linter($this->content ?? ''); + if (!empty($this->content)) { + $linter = new Linter($this->content); - $this->content = $linter->format(); + $this->content = $linter->format(); - $this->save(); + $this->save(); + } } /**