From e9de526eab75fd4ff218477966dbf813de96f42d Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 23 Sep 2021 19:51:05 +0200 Subject: [PATCH] wip #4697 --- src/Files/VirtualDirectory.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Files/VirtualDirectory.php b/src/Files/VirtualDirectory.php index 828b0fb..918ccb3 100644 --- a/src/Files/VirtualDirectory.php +++ b/src/Files/VirtualDirectory.php @@ -26,7 +26,7 @@ class VirtualDirectory public function copy($from, $to) { if (!file_exists($from)) { - throw new \Exception(sprintf('File %s doesn\'t exist', $from)); + throw new \Exception(sprintf('File %s doesn\'t exist (to %s)', $from, $to)); } $realto = $this->path($to); if (!$realto) { @@ -118,6 +118,9 @@ class VirtualDirectory } $path = $file->getRealPath(); $dest = str_replace($from, '', $path); + if(!$path){ + continue; + } $this->copy($path, $this->relativePath($to) . '/' . ltrim($dest, '/')); } } -- 2.39.5