mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Fix 'cannot read split of undefined' error
This commit is contained in:
@@ -316,14 +316,15 @@ export class ClaudeDev {
|
|||||||
const completeDiffStringConverted = completeDiffStringRaw
|
const completeDiffStringConverted = completeDiffStringRaw
|
||||||
.map((part, index) => {
|
.map((part, index) => {
|
||||||
const prefix = part.added ? "+ " : part.removed ? "- " : " "
|
const prefix = part.added ? "+ " : part.removed ? "- " : " "
|
||||||
return (part.value ?? [])
|
const value = part.value || ""
|
||||||
|
return value
|
||||||
.split("\n")
|
.split("\n")
|
||||||
.map((line, lineIndex) => {
|
.map((line, lineIndex) => {
|
||||||
// avoid adding an extra empty line at the very end of the diff output
|
// avoid adding an extra empty line at the very end of the diff output
|
||||||
if (
|
if (
|
||||||
line === "" &&
|
line === "" &&
|
||||||
index === completeDiffStringRaw.length - 1 &&
|
index === completeDiffStringRaw.length - 1 &&
|
||||||
lineIndex === (part.value ?? []).split("\n").length - 1
|
lineIndex === value.split("\n").length - 1
|
||||||
) {
|
) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user