Could it be?

This commit is contained in:
phoenix
2026-01-01 14:28:55 -05:00
parent 400490b633
commit a0bab48f40
2 changed files with 8 additions and 8 deletions
+8 -3
View File
@@ -3,6 +3,7 @@ package mock
import (
"context"
"errors"
"fmt"
"sync"
"git.kundeng.us/phoenix/textsender-models/tx0/message"
@@ -37,9 +38,13 @@ func (m *MockMessageStore) CreateMessage(ctx context.Context, msg *message.Messa
}
var id uuid.UUID
if msg.Id != nil && *msg.Id == uuid.Nil {
id = uuid.New()
msg.Id = &id
if msg != nil {
if msg.Id == nil || *msg.Id == uuid.Nil {
id = uuid.New()
msg.Id = &id
}
} else {
return fmt.Errorf("Message not populated")
}
key := MessageKey{Content: msg.Content, UserId: *msg.UserId}