fix dislike crash when no claim

This commit is contained in:
zeppi 2021-08-06 13:05:30 -04:00 committed by jessopb
parent 1487b83ac5
commit 5b4d8065e6

View file

@ -54,11 +54,10 @@ export const makeSelectLikeCountForUri = (uri) =>
export const makeSelectDislikeCountForUri = (uri) =>
createSelector(makeSelectClaimForUri(uri), makeSelectReactionsForUri(uri), (claim, reactions) => {
const claimId = claim.claim_id;
if (!reactions || reactions.my_reactions === null || reactions.others_reactions === null) {
if (!claim || !reactions || reactions.my_reactions === null || reactions.others_reactions === null) {
return 0;
}
const claimId = claim.claim_id;
let count = 0;
if (reactions.others_reactions) {