Fix: Removed setting validation as it is not strictly necessary

This commit is contained in:
NebelKreis 2024-11-20 11:55:48 +01:00
parent 5639a84d90
commit d5c141dc59

View file

@ -1245,17 +1245,11 @@ class AssetsController extends Controller
try { try {
$settings = Setting::getSettings(); $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 // 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 // This prevents errors when trying to include a non-existent logo in the PDF
$original_logo = $settings->label_logo; $settings->label_logo = ($original_logo = $settings->label_logo) && !Storage::disk('public')->exists('/' . $original_logo) ? null : $settings->label_logo;
if ($original_logo && !Storage::disk('public')->exists('/' . $original_logo)) {
$settings->label_logo = null;
}
$label = new Label(); $label = new Label();