Skip to content

Commit a84393e

Browse files
committed
chore($AnimateRunner): examine the document more carefully
Some internal tests were failing because the `$document[0]` value was null. This fix ensures that the if statement surrounding that is more careful.
1 parent c429ad8 commit a84393e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ng/animateRunner.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ var $$AnimateRunnerFactoryProvider = function() {
8181

8282
this._doneCallbacks = [];
8383
this._tick = function(fn) {
84-
if ($document[0].hidden) {
84+
var doc = $document[0];
85+
86+
// the document may not be ready or attached
87+
// to the module for some internal tests
88+
if (doc && doc.hidden) {
8589
timeoutTick(fn);
8690
} else {
8791
rafTick(fn);

0 commit comments

Comments
 (0)