BUGFIX: abstract shouldn't die for registrations without work
[angular-drzb] / app / js / controllers.js
index 2440bae..642a54d 100644 (file)
@@ -134,10 +134,12 @@ function RegistrationCtrl($scope, $log, Registration, $routeParams, $location, $
        }
 
        $scope.abstract_class = function(work) {
+               if ( work === undefined ) return;
                var abstract = work.abstract;
                return angular.isString(abstract) && abstract.length <= 2000 ? 'ok' : 'ng-invalid';
        }
        $scope.abstract_length = function(work) {
+               if ( work === undefined ) return;
                var abstract = work.abstract;
                if ( ! abstract ) return 0;
                return abstract.length <= 2000 ? abstract.length : 2000 - abstract.length;