fix TypeError: guard against undefined blockContent in tool/call delegates
This commit is contained in:
parent
c39e0f2723
commit
38df1a8e32
|
|
@ -622,7 +622,7 @@ ApplicationWindow {
|
|||
Text {
|
||||
id: callText
|
||||
Layout.fillWidth: true
|
||||
text: visible ? chatModel.prettyJson(block.blockContent) : ""
|
||||
text: visible ? chatModel.prettyJson(block.blockContent || "") : ""
|
||||
textFormat: Text.RichText
|
||||
wrapMode: Text.Wrap
|
||||
font.family: "monospace"
|
||||
|
|
@ -653,8 +653,9 @@ ApplicationWindow {
|
|||
Layout.fillWidth: true
|
||||
text: {
|
||||
if (!visible) return ""
|
||||
let content = block.blockContent
|
||||
let trimmed = content.trimStart()
|
||||
let content = block.blockContent || ""
|
||||
if (!content) return ""
|
||||
let trimmed = content.trim()
|
||||
if (trimmed.startsWith("{") || trimmed.startsWith("["))
|
||||
return chatModel.prettyJson(content)
|
||||
if (trimmed.startsWith("---") || trimmed.startsWith("diff "))
|
||||
|
|
|
|||
Reference in New Issue