From c3ee85bf359587ea4c343cf0e9a77fc5cd1ff641 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Mon, 4 Nov 2024 01:41:08 +0300 Subject: [PATCH] nil pointer dereference fix (#37) --- llm/request_context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llm/request_context.go b/llm/request_context.go index 05dd1df..a582b76 100644 --- a/llm/request_context.go +++ b/llm/request_context.go @@ -99,7 +99,7 @@ func chatMessageToOpenAiChatCompletionMessage(message ChatMessage) openai.ChatCo func chatMessageToText(message ChatMessage) string { var msgText string - if message.ReplyTo == nil { + if message.ReplyTo != nil { msgText += "In reply to:" msgText += quoteText(presentUserMessageAsText(*message.ReplyTo)) + "\n\n" }