diff --git a/src/UploadBehavior.php b/src/UploadBehavior.php index 34d5978..3d4a995 100644 --- a/src/UploadBehavior.php +++ b/src/UploadBehavior.php @@ -282,7 +282,7 @@ protected function save($file, $path) protected function delete($attribute, $old = false) { $path = $this->getUploadPath($attribute, $old); - if (is_file($path)) { + if (is_string($path) && is_file($path)) { unlink($path); } }