don't die on undefined registration or user
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 14 Feb 2013 15:54:59 +0000 (16:54 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 14 Feb 2013 15:54:59 +0000 (16:54 +0100)
app/js/controllers.js

index 3c43f53..4ddca47 100644 (file)
@@ -160,6 +160,7 @@ function RegistrationCtrl($scope, $log, Registration, $routeParams, $location, $
 
        $scope.show_submission_type = function() {
                // FIXME check if all submission are allowed by date and allow them!
+               if ( angular.isUndefined( $scope.user ) || angular.isUndefined( $scope.registration ) ) return false;
                return (
                        angular.isUndefined( $scope.user.registration_type ) // new registration
                        || angular.isUndefined( $scope.registration.state ) // not saved yet