diff --git a/app/components/post_list/post_list.js b/app/components/post_list/post_list.js index 50e6989c8..a057f2639 100644 --- a/app/components/post_list/post_list.js +++ b/app/components/post_list/post_list.js @@ -292,16 +292,17 @@ export default class PostList extends PureComponent { width > 0 && height > 0 && this.props.initialIndex > 0 && - !this.hasDoneInitialScroll && - this.flatListRef?.current + !this.hasDoneInitialScroll ) { requestAnimationFrame(() => { - this.flatListRef.current.scrollToIndex({ - animated: false, - index: this.props.initialIndex, - viewOffset: 0, - viewPosition: 1, // 0 is at bottom - }); + if (this.flatListRef?.current) { + this.flatListRef.current.scrollToIndex({ + animated: false, + index: this.props.initialIndex, + viewOffset: 0, + viewPosition: 1, // 0 is at bottom + }); + } }); this.hasDoneInitialScroll = true; }