TUI: fix: add null check for user.time in duration calculation (#4679)

This commit is contained in:
Carli Samuele 2025-11-24 09:06:09 +01:00 committed by GitHub
parent 75c0c0a098
commit bcb494d5d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1008,7 +1008,7 @@ function AssistantMessage(props: { message: AssistantMessage; parts: Part[]; las
if (!final()) return 0
if (!props.message.time.completed) return 0
const user = messages().find((x) => x.role === "user" && x.id === props.message.parentID)
if (!user) return 0
if (!user || !user.time) return 0
return props.message.time.completed - user.time.created
})