Skip to content

Commit d042160

Browse files
committed
Add condition to avoid call deleteImage() w/ empty filename
Signed-off-by: pacoorozco <[email protected]>
1 parent 63dbbc7 commit d042160

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/HasImageUploads.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ public function uploadImage(UploadedFile $imageFile, ?string $field = null): sel
369369
$this->updateModel($filePath, $this->uploadFieldName);
370370

371371
// delete old file
372-
if ($currentFile != $filePath) {
372+
if (!empty($currentFile) && $currentFile != $filePath) {
373373
$this->deleteImage($currentFile);
374374
}
375375

0 commit comments

Comments
 (0)