Skip to content

Commit 7f0449c

Browse files
authored
Update hooks.js
This check for post fixes the issue that is caused in the new MFE discussion sidebar as mentioned in #751
1 parent 58aa512 commit 7f0449c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/discussions/posts/data/hooks.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ const usePostList = (ids) => {
1111

1212
const sortedIds = useMemo(() => {
1313
posts.forEach((post) => {
14-
if (post.pinned) {
14+
if (post && post.pinned) {
1515
pinnedPostsIds.push(post.id);
16-
} else {
16+
} else if (post) {
1717
unpinnedPostsIds.push(post.id);
1818
}
1919
});

0 commit comments

Comments
 (0)