From 660ab7e22df116d28c3474b91667a0a5727c3ca0 Mon Sep 17 00:00:00 2001 From: josdejong Date: Thu, 6 Mar 2014 10:36:28 +0100 Subject: [PATCH] Checking for existence of `window` before using it --- src/graph/Graph.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/graph/Graph.js b/src/graph/Graph.js index 7e91342b..28bc1469 100644 --- a/src/graph/Graph.js +++ b/src/graph/Graph.js @@ -1805,9 +1805,10 @@ Graph.prototype._animationStep = function() { this.renderTime = Date.now() - renderTime; }; - -window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || - window.webkitRequestAnimationFrame || window.msRequestAnimationFrame; +if (typeof window !== 'undefined') { + window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || + window.webkitRequestAnimationFrame || window.msRequestAnimationFrame; +} /** * Schedule a animation step with the refreshrate interval.