Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Fix crash caused by selectors (#283)
Browse files Browse the repository at this point in the history
* Fix crash caused by selectors

* Feedback review
  • Loading branch information
enahum authored and hmhealey committed Aug 28, 2020
1 parent 2ba61bc commit df46511
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/mattermost-redux/src/selectors/entities/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ export const getSearchResults = createSelector(
getAllPosts,
(state) => state.entities.search.results,
(posts, postIds) => {
if (!postIds) {
return [];
}

return postIds.map((id) => posts[id]);
}
);
Expand All @@ -336,6 +340,10 @@ export function makeGetPostsForIds() {
getAllPosts,
(state, postIds) => postIds,
(allPosts, postIds) => {
if (!postIds) {
return [];
}

return postIds.map((id) => allPosts[id]);
}
);
Expand Down

0 comments on commit df46511

Please sign in to comment.