diff options
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/tui/internal/app/prompt.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/tui/internal/app/prompt.go b/packages/tui/internal/app/prompt.go index 8701a2072..bd5086a45 100644 --- a/packages/tui/internal/app/prompt.go +++ b/packages/tui/internal/app/prompt.go @@ -43,6 +43,9 @@ func (p Prompt) ToMessage( } for _, att := range textAttachments { if source, ok := att.GetTextSource(); ok { + if att.StartIndex > att.EndIndex || att.EndIndex > len(text) { + continue + } text = text[:att.StartIndex] + source.Value + text[att.EndIndex:] } } |
