Private
Public Access
1
0

fix bug where mock server crashes when sending more than one update

This commit is contained in:
2025-05-01 20:48:43 -07:00
parent bdf76ca725
commit 05b4beb2fb

View File

@@ -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
}