safety fixes

Reviewed By: nspaun

Differential Revision: D2902378

fb-gh-sync-id: da35b6d61e6248e5920eab6f5e53a7ce8deb8e01
This commit is contained in:
Olivier Notteghem 2016-02-04 15:45:25 -08:00 committed by facebook-github-bot-7
parent 184c708b14
commit 4326b01181

View File

@ -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);
},
/**