Skip to content

Commit

Permalink
fix: just for safety
Browse files Browse the repository at this point in the history
  • Loading branch information
jibon57 committed Feb 20, 2025
1 parent 2be4cec commit 17ba8f4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/controllers/nats.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,11 @@ func (c *NatsController) subscribeToSystemWorker(stream jetstream.Stream) {
req := new(plugnmeet.NatsMsgClientToServer)
if err := proto.Unmarshal(data, req); err == nil {
p := strings.Split(sub, ".")
roomId := p[1]
userId := p[2]
c.natsModel.HandleFromClientToServerReq(roomId, userId, req)
if len(p) == 3 {
roomId := p[1]
userId := p[2]
c.natsModel.HandleFromClientToServerReq(roomId, userId, req)
}
}
}(msg.Subject(), msg.Data())
}, jetstream.ConsumeErrHandler(func(consumeCtx jetstream.ConsumeContext, err error) {
Expand Down

0 comments on commit 17ba8f4

Please sign in to comment.