Defensive fix for post list scrollToIndex (#1223)
This commit is contained in:
parent
8233907b47
commit
18a5535205
1 changed files with 1 additions and 1 deletions
|
|
@ -81,7 +81,7 @@ export default class PostList extends PureComponent {
|
|||
|
||||
scrollList = () => {
|
||||
InteractionManager.runAfterInteractions(() => {
|
||||
if (this.props.postIds.length && this.newMessagesIndex !== -1) {
|
||||
if (this.props.postIds.length && this.newMessagesIndex !== -1 && this.newMessagesIndex <= this.props.postIds.length) {
|
||||
if (this.refs.list) {
|
||||
this.refs.list.scrollToIndex({
|
||||
index: this.newMessagesIndex,
|
||||
|
|
|
|||
Loading…
Reference in a new issue