From 9684e2dec933f1be80543748f1753761006c3d5f Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 18 Jul 2021 14:06:32 +0200 Subject: Fixed the bug caused by inproper handling of empty patches --- packages/client/src/components/CommitPatch.vue | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'packages/client/src/components') 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")); -- cgit v1.2.3-18-g5258