mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
Check that the $use_db_field
has a value before attempting a delete
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
4f8951f6f1
commit
9d0a15990e
|
@ -146,7 +146,7 @@ class ImageUploadRequest extends Request
|
|||
}
|
||||
|
||||
// Remove Current image if exists
|
||||
if (Storage::disk('public')->exists($path.'/'.$item->{$use_db_field})) {
|
||||
if (($item->{$use_db_field}!='') && (Storage::disk('public')->exists($path.'/'.$item->{$use_db_field}))) {
|
||||
\Log::debug('A file already exists that we are replacing - we should delete the old one.');
|
||||
try {
|
||||
Storage::disk('public')->delete($path.'/'.$item->{$use_db_field});
|
||||
|
|
Loading…
Reference in a new issue