handle no user set for personal global auth

This commit is contained in:
Robin Appelman 2016-02-08 13:45:52 +01:00
parent 97b2e19c78
commit 678a3abf6d

View file

@ -74,6 +74,8 @@ class GlobalAuth extends AuthMechanism {
public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
if ($storage->getType() === StorageConfig::MOUNT_TYPE_ADMIN) {
$uid = '';
} elseif (is_null($user)) {
throw new InsufficientDataForMeaningfulAnswerException('No credentials saved');
} else {
$uid = $user->getUID();
}