From 4326b01181559a908740cda0a4c8459c9bdb919d Mon Sep 17 00:00:00 2001 From: Olivier Notteghem Date: Thu, 4 Feb 2016 15:45:25 -0800 Subject: [PATCH] safety fixes Reviewed By: nspaun Differential Revision: D2902378 fb-gh-sync-id: da35b6d61e6248e5920eab6f5e53a7ce8deb8e01 --- Libraries/CustomComponents/ListView/ListView.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Libraries/CustomComponents/ListView/ListView.js b/Libraries/CustomComponents/ListView/ListView.js index f0140f8e4..2ebbf24e6 100644 --- a/Libraries/CustomComponents/ListView/ListView.js +++ b/Libraries/CustomComponents/ListView/ListView.js @@ -230,15 +230,18 @@ var ListView = React.createClass({ * Provides a handle to the underlying scroll responder. */ getScrollResponder: function() { - return this.refs[SCROLLVIEW_REF].getScrollResponder(); + return this.refs[SCROLLVIEW_REF] && + this.refs[SCROLLVIEW_REF].getScrollResponder(); }, scrollTo: function(...args) { - this.refs[SCROLLVIEW_REF].scrollTo(...args); + this.refs[SCROLLVIEW_REF] && + this.refs[SCROLLVIEW_REF].scrollTo(...args); }, setNativeProps: function(props) { - this.refs[SCROLLVIEW_REF].setNativeProps(props); + this.refs[SCROLLVIEW_REF] && + this.refs[SCROLLVIEW_REF].setNativeProps(props); }, /**