Fix crash for null reactions set

pull/21833/head
J. Ryan Stinnett 2019-05-16 13:57:02 +01:00
parent 88bee3363c
commit 006d5d7591
2 changed files with 10 additions and 2 deletions

View File

@ -113,7 +113,11 @@ export default class ReactionDimension extends React.PureComponent {
return null;
}
const userId = MatrixClientPeg.get().getUserId();
return [...reactions.getAnnotationsBySender()[userId].values()];
const myReactions = reactions.getAnnotationsBySender()[userId];
if (!myReactions) {
return null;
}
return [...myReactions.values()];
}
onOptionClick = (ev) => {

View File

@ -86,7 +86,11 @@ export default class ReactionsRow extends React.PureComponent {
return null;
}
const userId = MatrixClientPeg.get().getUserId();
return [...reactions.getAnnotationsBySender()[userId].values()];
const myReactions = reactions.getAnnotationsBySender()[userId];
if (!myReactions) {
return null;
}
return [...myReactions.values()];
}
render() {