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
1 changed files with 2 additions and 0 deletions

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();
}