Skip to content

Commit

Permalink
fix: check null topics
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Feb 11, 2021
1 parent 58cd797 commit b753c69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/topics/thumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Thumbs.load = async function (topicData) {
const tidsWithThumbs = topicsWithThumbs.map(t => t.tid);
const thumbs = await Thumbs.get(tidsWithThumbs);
const tidToThumbs = _.zipObject(tidsWithThumbs, thumbs);
return topicData.map(t => tidToThumbs[t.tid] || []);
return topicData.map(t => (t && t.tid ? (tidToThumbs[t.tid] || []) : []));
};

Thumbs.get = async function (tids) {
Expand Down

0 comments on commit b753c69

Please sign in to comment.