diff options
Diffstat (limited to 'apps/files_external/lib/google.php')
-rw-r--r-- | apps/files_external/lib/google.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php index 215bdcda6c2..b63b5885de1 100644 --- a/apps/files_external/lib/google.php +++ b/apps/files_external/lib/google.php @@ -206,14 +206,16 @@ class Google extends \OC\Files\Storage\Common { public function rmdir($path) { if (trim($path, '/') === '') { $dir = $this->opendir($path); - while (($file = readdir($dh)) !== false) { - if (!\OC\Files\Filesystem::isIgnoredDir($file)) { - if (!$this->unlink($path.'/'.$file)) { - return false; + if(is_resource($dir)) { + while (($file = readdir($dir)) !== false) { + if (!\OC\Files\Filesystem::isIgnoredDir($file)) { + if (!$this->unlink($path.'/'.$file)) { + return false; + } } } + closedir($dir); } - closedir($dir); $this->driveFiles = array(); return true; } else { |