diff options
author | HampusM <hampus@hampusmat.com> | 2021-07-18 14:06:32 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-07-18 14:06:32 +0200 |
commit | 9684e2dec933f1be80543748f1753761006c3d5f (patch) | |
tree | 2d5fcc0d79dd948ffdfab208e8003b83967e6e26 /packages/client/src/components | |
parent | 2e333f01de88217f33ed2fb9ba0c18ed1357419c (diff) |
Fixed the bug caused by inproper handling of empty patches
Diffstat (limited to 'packages/client/src/components')
-rw-r--r-- | packages/client/src/components/CommitPatch.vue | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/client/src/components/CommitPatch.vue b/packages/client/src/components/CommitPatch.vue index dca886f..fbc9e3a 100644 --- a/packages/client/src/components/CommitPatch.vue +++ b/packages/client/src/components/CommitPatch.vue @@ -19,6 +19,12 @@ export default defineComponent({ ]); } + if(!props.patch.hunks) { + return () => h("div", { class: "ps-3 pt-3" }, [ + h("span", "Empty.") + ]); + } + // Array of hunks without the first chunk headers const all_hunks = props.patch.hunks.map((hunk) => hunk.hunk.split("\n").slice(1).join("\n")); |