From 05b4beb2fb320d704542cfb722f22f00a902a635 Mon Sep 17 00:00:00 2001 From: James Magahern Date: Thu, 1 May 2025 20:48:43 -0700 Subject: [PATCH] fix bug where mock server crashes when sending more than one update --- prompt/prompt.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prompt/prompt.go b/prompt/prompt.go index 525462c..41e19b3 100644 --- a/prompt/prompt.go +++ b/prompt/prompt.go @@ -6,11 +6,11 @@ import ( "strings" "time" - "go.buzzert.net/kordophone-mock/model" - "go.buzzert.net/kordophone-mock/server" "github.com/chzyer/readline" "github.com/google/uuid" "github.com/rs/zerolog/log" + "go.buzzert.net/kordophone-mock/model" + "go.buzzert.net/kordophone-mock/server" ) type Prompt struct { @@ -22,7 +22,7 @@ func (p *Prompt) conversationForGUID(guid string) (*model.Conversation, error) { if guid == "*" { // This means any conversation: return the first one (that's not the special Attachments convo) convo := p.server.SortedConversations()[0] - if *convo.DisplayName == server.ATTACHMENT_CONVO_DISP_NAME { + if convo.DisplayName != nil && *convo.DisplayName == server.ATTACHMENT_CONVO_DISP_NAME { return &p.server.SortedConversations()[1], nil }