[MM-16456] Ensure Flatlist is mounted prior to calling scrollToOffset (#2925)

* Ensure Flatlist is mounted prior to calling scrollToOffset

* Make linter happy
This commit is contained in:
Miguel Alatzar 2019-06-26 02:01:44 -07:00 committed by Saturnino Abril
parent c121f66526
commit fdb6cc6b2a

View file

@ -281,7 +281,9 @@ export default class PostList extends PureComponent {
scrollToBottom = () => {
setTimeout(() => {
this.flatListRef.current.scrollToOffset({offset: 0, animated: true});
if (this.flatListRef && this.flatListRef.current) {
this.flatListRef.current.scrollToOffset({offset: 0, animated: true});
}
}, 250);
};