fix bug where mock server crashes when sending more than one update
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user