Skip to content

Commit

Permalink
Merge pull request #68 from muzzammilshahid/handle-nil-option
Browse files Browse the repository at this point in the history
Handle nil options in NewSubscribe
  • Loading branch information
muzzammilshahid authored Aug 16, 2024
2 parents b722ee9 + e806d70 commit aaf15c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions messages/subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ type Subscribe struct {
}

func NewSubscribe(requestID int64, options map[string]any, uri string) *Subscribe {
if options == nil {
options = make(map[string]any)
}

return &Subscribe{SubscribeFields: &subscribeFields{requestID: requestID, options: options, topic: uri}}
}

Expand Down

0 comments on commit aaf15c0

Please sign in to comment.