From: Dobrica Pavlinusic Date: Thu, 14 Feb 2013 15:54:59 +0000 (+0100) Subject: don't die on undefined registration or user X-Git-Tag: 0.8~8 X-Git-Url: http://git.rot13.org/?p=angular-drzb;a=commitdiff_plain;h=7dfbd7031b7ca284c8551f65dcd8b0a2ba0a5594 don't die on undefined registration or user --- diff --git a/app/js/controllers.js b/app/js/controllers.js index 3c43f53..4ddca47 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -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