Skip to content

Commit

Permalink
Merge pull request #1 from IGORm90/add_check_attributes
Browse files Browse the repository at this point in the history
add check attributes
  • Loading branch information
SergeyMiracle authored Feb 6, 2023
2 parents a4a2735 + 4f87c5c commit 12738e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/UploadableModelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ public function performDeletes(): void
$options = $this->getUploadableOptions();

foreach ($options['attributes'] as $key) {
UploadableFileHandler::delete($this->attributes[$key], $options['disk'] ?? null);
if (isset($this->attributes[$key]) && !is_null($this->attributes[$key])) {
UploadableFileHandler::delete($this->attributes[$key], $options['disk'] ?? null);
}
}
}

Expand Down

0 comments on commit 12738e7

Please sign in to comment.