From aa310366adbece91fa536694e3143c436ac9e27c Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Sat, 20 Jul 2024 16:17:43 -0400 Subject: [PATCH] Fix 'cannot read split of undefined' error --- src/ClaudeDev.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ClaudeDev.ts b/src/ClaudeDev.ts index c49596c..b4c9b5f 100644 --- a/src/ClaudeDev.ts +++ b/src/ClaudeDev.ts @@ -316,14 +316,15 @@ export class ClaudeDev { const completeDiffStringConverted = completeDiffStringRaw .map((part, index) => { const prefix = part.added ? "+ " : part.removed ? "- " : " " - return (part.value ?? []) + const value = part.value || "" + return value .split("\n") .map((line, lineIndex) => { // avoid adding an extra empty line at the very end of the diff output if ( line === "" && index === completeDiffStringRaw.length - 1 && - lineIndex === (part.value ?? []).split("\n").length - 1 + lineIndex === value.split("\n").length - 1 ) { return null }