Skip to content

Commit

Permalink
fix nil pointer error.
Browse files Browse the repository at this point in the history
  • Loading branch information
mo3et committed Oct 11, 2024
1 parent aace5a3 commit 699523f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/conversation_msg/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,10 @@ func (c *Conversation) GetConversationIDBySessionType(_ context.Context, sourceI

func (c *Conversation) SendMessage(ctx context.Context, s *sdk_struct.MsgStruct, recvID, groupID string, p *sdkws.OfflinePushInfo, isOnlineOnly bool) (*sdk_struct.MsgStruct, error) {
// Message is created by URL
if s.FileElem.SourceURL != "" || s.SoundElem.SourceURL != "" || s.VideoElem.VideoURL != "" || (s.PictureElem.SourcePicture.Url != "" || s.PictureElem.BigPicture.Url != "" || s.PictureElem.SnapshotPicture.Url != "") {
if (s.FileElem != nil && s.FileElem.SourceURL != "") ||
(s.SoundElem != nil && s.SoundElem.SourceURL != "") ||
(s.VideoElem != nil && s.VideoElem.VideoURL != "") ||
(s.PictureElem != nil && (s.PictureElem.SourcePicture.Url != "" || s.PictureElem.BigPicture.Url != "" || s.PictureElem.SnapshotPicture.Url != "")) {
return c.sendMessageNotOss(ctx, s, recvID, groupID, p, isOnlineOnly)
}

Expand Down

0 comments on commit 699523f

Please sign in to comment.