fix comments npe

This commit is contained in:
Peng Lyu
2019-02-12 09:18:35 -08:00
parent 97bfb45f87
commit 0d50120c71

View File

@@ -270,12 +270,12 @@ function convertToComment(provider: vscode.DocumentCommentProvider | vscode.Work
canDelete: canDelete,
command: vscodeComment.command ? commandsConverter.toInternal(vscodeComment.command) : null,
isDraft: vscodeComment.isDraft,
commentReactions: vscodeComment.commentReactions.map(reaction => {
commentReactions: vscodeComment.commentReactions ? vscodeComment.commentReactions.map(reaction => {
return {
label: reaction.label,
hasReacted: reaction.hasReacted,
canEdit: (reaction.hasReacted && providerCanDeleteReaction) || (!reaction.hasReacted && providerCanAddReaction)
};
})
}) : undefined
};
}