Do not throw errors if a group has a uid which is not yet known

This can happen if the users have not yet loaded fully
This commit is contained in:
Johannes Zellner
2018-08-02 22:16:55 +02:00
parent 510115ade9
commit 739c91b1c6

View File

@@ -15,7 +15,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
$scope.userInfo = Client.getUserInfo();
$scope.groupMembers = function (group) {
return group.userIds.map(function (uid) { return $scope.usersById[uid].username || $scope.usersById[uid].email; }).join(', ');
return group.userIds.filter(function (uid) { return !!$scope.usersById[uid]; }).map(function (uid) { return $scope.usersById[uid].username || $scope.usersById[uid].email; }).join(', ');
};
$scope.userremove = {