From 5dbb0b0815c170cc26b8bedd372bfdd1fde336c8 Mon Sep 17 00:00:00 2001 From: Laura Date: Wed, 27 Aug 2025 17:24:08 +0200 Subject: [PATCH] small fix --- chat.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chat.go b/chat.go index 7ef2610..1179cfb 100644 --- a/chat.go +++ b/chat.go @@ -409,6 +409,10 @@ func SplitImagePairs(text string) []openrouter.ChatMessagePart { ) push := func(str, end int) { + if str > end { + return + } + rest := text[str:end] if rest == "" {