Skip to content

Commit

Permalink
fix file unlinking
Browse files Browse the repository at this point in the history
  • Loading branch information
kolirt committed Jul 10, 2024
1 parent c6b8d9a commit 28f9389
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"fill"
],
"license": "MIT",
"version": "3.0.2",
"version": "3.0.3",
"authors": [
{
"name": "kolirt"
Expand Down
2 changes: 1 addition & 1 deletion src/MasterModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function fill(array $attributes)

try {
$path = $this->$key;
if ($value != $this->$key && file_exists(storage_path($path)) && $path) {
if (is_string($path) && $value != $this->$key && file_exists(storage_path($path)) && $path) {
unlink(storage_path() . $path);
}
} catch (\Exception $e) {
Expand Down

0 comments on commit 28f9389

Please sign in to comment.