Skip to content

Commit

Permalink
Update hooks.js
Browse files Browse the repository at this point in the history
This check for post fixes the issue that is caused in the new MFE discussion sidebar as mentioned in #751
  • Loading branch information
zameel7 authored Feb 1, 2025
1 parent 58aa512 commit 7f0449c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/discussions/posts/data/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const usePostList = (ids) => {

const sortedIds = useMemo(() => {
posts.forEach((post) => {
if (post.pinned) {
if (post && post.pinned) {
pinnedPostsIds.push(post.id);
} else {
} else if (post) {
unpinnedPostsIds.push(post.id);
}
});
Expand Down

0 comments on commit 7f0449c

Please sign in to comment.