A free open source IT asset/license management system
Improve check for image existence
Marcus Moore54f5f46e3123
diff --git a/app/Http/Controllers/Components/ComponentsController.php b/app/Http/Controllers/Components/ComponentsController.phpindex c4d9bcec36..62dc25cf1d 100644--- a/app/Http/Controllers/Components/ComponentsController.php+++ b/app/Http/Controllers/Components/ComponentsController.php@@ -193,7 +193,7 @@ class ComponentsController extends Controller$this->authorize('delete', $component);// Remove the image if one exists- if (Storage::disk('public')->exists('components/'.$component->image)) {+ if ($component->image && Storage::disk('public')->exists('components/' . $component->image)) {try {Storage::disk('public')->delete('components/'.$component->image);} catch (\Exception $e) {