From f4d88a350ace3d76a43fdcf75e2d732dcaf5cd80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Tue, 27 Aug 2024 15:13:56 +0100 Subject: [PATCH] Fixed document item search 500 issue for missing Category with item.. --- app/Models/Setting/Category.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Models/Setting/Category.php b/app/Models/Setting/Category.php index 0c6b0fecd..239965176 100644 --- a/app/Models/Setting/Category.php +++ b/app/Models/Setting/Category.php @@ -253,7 +253,9 @@ class Category extends Model */ public function getColorHexCodeAttribute(): string { - return $this->getHexCodeOfTailwindClass($this->color); + $color = $this->color ?? 'green-500'; + + return $this->getHexCodeOfTailwindClass($color); } /**