From ca8e4147b546c53eb91707b1485086d7ee974a5c Mon Sep 17 00:00:00 2001 From: kaesonho Date: Tue, 28 Jul 2015 14:09:11 -0700 Subject: [PATCH] add error handling to check react component --- src/mixins/I13nMixin.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mixins/I13nMixin.js b/src/mixins/I13nMixin.js index 00a0e336..af8ab6ce 100644 --- a/src/mixins/I13nMixin.js +++ b/src/mixins/I13nMixin.js @@ -119,6 +119,7 @@ var I13nMixin = { if (!this._getReactI13n()) { return; } + clearTimeout(pageInitViewportDetectionTimeout); this._createI13nNode(); this._i13nNode.setReactComponent(this); }, @@ -306,7 +307,10 @@ var I13nMixin = { self._detectViewport(function detectCallback () { if (self._i13nNode.isInViewport()) { self._i13nNode.getChildrenNodes().forEach(function detectChildrenViewport (childNode) { - childNode.getReactComponent()._recursiveDetectViewport(); + var reactComponent = childNode.getReactComponent(); + if (reactComponent) { + reactComponent._recursiveDetectViewport(); + } }); } });