test if user existists in registration
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 23 Jan 2013 14:58:04 +0000 (15:58 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 23 Jan 2013 14:58:04 +0000 (15:58 +0100)
app/js/controllers.js

index 642a54d..303d7ef 100644 (file)
@@ -166,6 +166,11 @@ function ListCtrl($scope, $log, Registration, RegistrationTypes, $filter) {
                        }
                };
                angular.forEach( $scope.all_registrations, function(value, key) {
+                       if ( ! value.user ) {
+                               $log.error("all_registrations user corrupted for registration", key, value);
+                               return;
+                       }
+
                        var type = value.user.registration_type;
                        inc_count( type );
                        inc_count( '' ); // total