diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php
index 03385d649cb86bf5ba2ea3636cd67183b6131205..8eea740a9e5a13fb8c8e5ed866ce044958930753 100644
--- a/apps/files_sharing/sharedstorage.php
+++ b/apps/files_sharing/sharedstorage.php
@@ -32,8 +32,10 @@ class OC_Filestorage_Shared extends OC_Filestorage {
 	
 	public function __construct($arguments) {
 		$this->datadir = $arguments['datadir'];
-		if (!OC_Filesystem::is_dir($this->datadir)) {
+		if (OC_Share::getItemsInFolder($this->datadir) && !OC_Filesystem::is_dir($this->datadir)) {
 			OC_Filesystem::mkdir($this->datadir);
+		} else  if (OC_Filesystem::is_dir($this->datadir)) {
+			OC_Filesystem::rmdir($this->datadir);
 		}
 		$this->datadir .= "/";
 	}