fix: add optional chaining to prevent null reference in totalClineMessages

This commit is contained in:
Roo Code 2025-08-04 18:54:45 +00:00
parent b9b69ef9c5
commit 4509f27dcc

View file

@ -1676,7 +1676,7 @@ export class ClineProvider
}
return allMessages
})(),
totalClineMessages: this.getCurrentCline()?.clineMessages.length || 0,
totalClineMessages: this.getCurrentCline()?.clineMessages?.length || 0,
taskHistory: (taskHistory || [])
.filter((item: HistoryItem) => item.ts && item.task)
.sort((a: HistoryItem, b: HistoryItem) => b.ts - a.ts),