Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Rare $animate RTE issue #364

@ThomasBurleson

Description

@ThomasBurleson

Discovered a RTE in angular-animate.js:

TypeError: Cannot read property 'add' of undefined
    at resolveElementClasses (http://localhost:8200/js/angular-animate.js:480:22)
    at http://localhost:8200/js/angular-animate.js:1028:27
    at http://localhost:8200/js/angular-animate.js:469:22
    at Scope.$get.Scope.$digest (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.4/angular.js:13391:36)
    at Scope.$get.Scope.$apply (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.4/angular.js:13603:24)
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.4/angular.js:15334:36
    at completeOutstandingRequest (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.4/angular.js:4544:10)
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.4/angular.js:4849:7 angular.js:10734(anonymous function) angular.js:10734$get angular.js:7909$get.Scope.$digest angular.js:13393$get.Scope.$apply angular.js:13603(anonymous function) angular.js:15334completeOutstandingRequest angular.js:4544(anonymous function)

The argument cache === null in the call to resolveElementClasses(element, cache, state.active).

Can be fixed with || { add : [] , remove : [] } as shown below:

return cache.promise = runAnimationPostDigest(function(done) {
            var cache = element.data(STORAGE_KEY) || { add : [] , remove : [] };
            element.removeData(STORAGE_KEY);

            var state = element.data(NG_ANIMATE_STATE) || {};
            var classes = resolveElementClasses(element, cache, state.active);
            return !classes
              ? done()
              : performAnimation('setClass', classes, element, null, null, function() {
                  $delegate.setClass(element, classes[0], classes[1]);
                }, done);
          });

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions