diff --git a/apps/files_sharing/lib/external/mountprovider.php b/apps/files_sharing/lib/external/mountprovider.php
index 0bef3539c422580531846df88143c3f87442d06c..67d85f27d8129309b3b0e0f69a30911431127d7a 100644
--- a/apps/files_sharing/lib/external/mountprovider.php
+++ b/apps/files_sharing/lib/external/mountprovider.php
@@ -49,12 +49,13 @@ class MountProvider implements IMountProvider {
 	}
 
 	public function getMount(IUser $user, $data, IStorageFactory $storageFactory) {
-		$data['manager'] = $this;
+		$managerProvider = $this->managerProvider;
+		$manager = $managerProvider();
+		$data['manager'] = $manager;
 		$mountPoint = '/' . $user->getUID() . '/files/' . ltrim($data['mountpoint'], '/');
 		$data['mountpoint'] = $mountPoint;
 		$data['certificateManager'] = \OC::$server->getCertificateManager($user->getUID());
-		$managerProvider = $this->managerProvider;
-		return new Mount(self::STORAGE, $mountPoint, $data, $managerProvider(), $storageFactory);
+		return new Mount(self::STORAGE, $mountPoint, $data, $manager, $storageFactory);
 	}
 
 	public function getMountsForUser(IUser $user, IStorageFactory $loader) {