From d5c141dc59d305996da66a53dc05eb4ceeb99466 Mon Sep 17 00:00:00 2001 From: NebelKreis Date: Wed, 20 Nov 2024 11:55:48 +0100 Subject: [PATCH] Fix: Removed setting validation as it is not strictly necessary --- app/Http/Controllers/Api/AssetsController.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 8e3615d7bb..7a9f582213 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -1245,17 +1245,11 @@ class AssetsController extends Controller try { $settings = Setting::getSettings(); - - if (!$settings) { - throw new \Exception('Settings could not be loaded'); - } // Check if logo file exists in storage and disable logo if not found // This prevents errors when trying to include a non-existent logo in the PDF - $original_logo = $settings->label_logo; - if ($original_logo && !Storage::disk('public')->exists('/' . $original_logo)) { - $settings->label_logo = null; - } + $settings->label_logo = ($original_logo = $settings->label_logo) && !Storage::disk('public')->exists('/' . $original_logo) ? null : $settings->label_logo; + $label = new Label();