From 521ee1e2d88cb7a2c93e8da5645d4debafbe5ffb Mon Sep 17 00:00:00 2001 From: Islam Magdy Date: Sat, 6 Jan 2018 04:30:13 +0200 Subject: [PATCH] Fix for 17348 Fixes https://github.com/facebook/react-native/issues/17348 - Unhandled JS Exception: TypeError: undefined is not an object (evaluating 'this._subscribableSubscriptions.forEach') --- Libraries/Components/Subscribable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Components/Subscribable.js b/Libraries/Components/Subscribable.js index 8474b214994f4b..086c97c991f108 100644 --- a/Libraries/Components/Subscribable.js +++ b/Libraries/Components/Subscribable.js @@ -30,7 +30,7 @@ Subscribable.Mixin = { }, componentWillUnmount: function() { - this._subscribableSubscriptions.forEach( + this._subscribableSubscriptions && this._subscribableSubscriptions.forEach( (subscription) => subscription.remove() ); this._subscribableSubscriptions = null;