Add defensive code for pendingPostIds (#1435)
This commit is contained in:
parent
70dada8daf
commit
7f02889efc
1 changed files with 1 additions and 1 deletions
|
|
@ -278,7 +278,7 @@ function cleanupState(action, keepCurrent = false) {
|
|||
});
|
||||
|
||||
// remove any pending posts that hasn't failed
|
||||
if (payload.entities.posts && payload.entities.posts.pendingPostIds.length) {
|
||||
if (payload.entities.posts && payload.entities.posts.pendingPostIds && payload.entities.posts.pendingPostIds.length) {
|
||||
const nextPendingPostIds = [...payload.entities.posts.pendingPostIds];
|
||||
payload.entities.posts.pendingPostIds.forEach((id) => {
|
||||
const posts = nextEntitites.posts.posts;
|
||||
|
|
|
|||
Loading…
Reference in a new issue