Fix for displaying left side comments when no discussion available

This commit is contained in:
Tim Zallmann 2018-09-03 22:56:09 +02:00
parent f8214f9568
commit cee271ee34
2 changed files with 10 additions and 6 deletions

View File

@ -57,7 +57,9 @@ export default {
);
},
showRightSideCommentForm() {
return this.line.right.type && this.diffLineCommentForms[this.rightLineCode];
return (
this.line.right && this.line.right.type && this.diffLineCommentForms[this.rightLineCode]
);
},
className() {
return (this.left && this.line.left.discussions.length > 0) ||

View File

@ -49,12 +49,14 @@ export const assignDiscussionsToDiff = ({ state }, allLineDiscussions) => {
}
}
const targetInlineLine = selectedFile.highlightedDiffLines.find(
line => line.lineCode === discussions[0].line_code,
);
if (selectedFile.highlightedDiffLines) {
const targetInlineLine = selectedFile.highlightedDiffLines.find(
line => line.lineCode === discussions[0].line_code,
);
if (targetInlineLine) {
Object.assign(targetInlineLine, { discussions });
if (targetInlineLine) {
Object.assign(targetInlineLine, { discussions });
}
}
}
}