diff --git a/static/js/controllers.js b/static/js/controllers.js index e44e3447b..2b2c4225e 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -1587,12 +1587,14 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use $scope.cuser = jQuery.extend({}, user); - for (var i = 0; i < $scope.cuser.logins.length; i++) { - if ($scope.cuser.logins[i].service == 'github') { - var githubId = $scope.cuser.logins[i].service_identifier; - $http.get('https://api.github.com/user/' + githubId).success(function(resp) { - $scope.githubLogin = resp.login; - }); + if ($scope.cuser.logins) { + for (var i = 0; i < $scope.cuser.logins.length; i++) { + if ($scope.cuser.logins[i].service == 'github') { + var githubId = $scope.cuser.logins[i].service_identifier; + $http.get('https://api.github.com/user/' + githubId).success(function(resp) { + $scope.githubLogin = resp.login; + }); + } } } });