mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-28 23:19:42 -08:00
Improve check for image existence
This commit is contained in:
parent
51a0767be9
commit
54f5f46e31
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue