Commit e5efa225 authored by Simon Knox's avatar Simon Knox

Add example usage of optional chaining

parent ad5b63c0
...@@ -62,8 +62,8 @@ export default { ...@@ -62,8 +62,8 @@ export default {
...this.diffFileCommentForm, ...this.diffFileCommentForm,
}); });
const diffFileHeadSha = // eslint-disable-next-line camelcase
this.commit && this.diffFile && this.diffFile.diff_refs && this.diffFile.diff_refs.head_sha; const diffFileHeadSha = this.commit && this?.diffFile?.diff_refs?.head_sha;
postData.data.note.commit_id = diffFileHeadSha || null; postData.data.note.commit_id = diffFileHeadSha || null;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment