diff options
Diffstat (limited to 'lib/connector/sabre')
-rw-r--r-- | lib/connector/sabre/objecttree.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/connector/sabre/objecttree.php b/lib/connector/sabre/objecttree.php index b298813a202..acff45ed5e2 100644 --- a/lib/connector/sabre/objecttree.php +++ b/lib/connector/sabre/objecttree.php @@ -88,11 +88,13 @@ class ObjectTree extends \Sabre_DAV_ObjectTree { } else { Filesystem::mkdir($destination); $dh = Filesystem::opendir($source); - while (($subnode = readdir($dh)) !== false) { + if(is_resource($dh)) { + while (($subnode = readdir($dh)) !== false) { - if ($subnode == '.' || $subnode == '..') continue; - $this->copy($source . '/' . $subnode, $destination . '/' . $subnode); + if ($subnode == '.' || $subnode == '..') continue; + $this->copy($source . '/' . $subnode, $destination . '/' . $subnode); + } } } |