From 28f93890d72a5fceafbf72bd18db6121591165a5 Mon Sep 17 00:00:00 2001 From: kolirt Date: Wed, 10 Jul 2024 09:15:09 +0300 Subject: [PATCH] fix file unlinking --- composer.json | 2 +- src/MasterModel.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index a30d4d1..821c9a9 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "fill" ], "license": "MIT", - "version": "3.0.2", + "version": "3.0.3", "authors": [ { "name": "kolirt" diff --git a/src/MasterModel.php b/src/MasterModel.php index 1e66eef..10eec03 100644 --- a/src/MasterModel.php +++ b/src/MasterModel.php @@ -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) {