only use mount provider if we have a valid user

This commit is contained in:
Robin Appelman 2015-05-07 14:40:44 +02:00
parent 24131586d7
commit 6f47a547d8

View file

@ -436,8 +436,10 @@ class Filesystem {
$mountConfigManager->listen('\OC\Files\Config', 'registerMountProvider', function (IMountProvider $provider) use ($userManager) {
foreach (Filesystem::$usersSetup as $user => $setup) {
$userObject = $userManager->get($user);
$mounts = $provider->getMountsForUser($userObject, Filesystem::getLoader());
array_walk($mounts, array(self::$mounts, 'addMount'));
if ($userObject) {
$mounts = $provider->getMountsForUser($userObject, Filesystem::getLoader());
array_walk($mounts, array(self::$mounts, 'addMount'));
}
}
});
}