Skip to content

Commit

Permalink
fix npe
Browse files Browse the repository at this point in the history
  • Loading branch information
kdudkov committed Nov 1, 2023
1 parent 915567d commit 8a32e9a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/client/client_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (h *ConnClientHandler) handleRead() {

cotmsg := &cot.CotMessage{
From: h.addr,
Scope: h.user.Scope,
Scope: h.getScope(),
TakMessage: msg,
Detail: d,
}
Expand Down Expand Up @@ -479,3 +479,11 @@ func (h *ConnClientHandler) tryAddPacket(msg []byte) bool {
}
return true
}

func (h *ConnClientHandler) getScope() string {
if h.user == nil {
return ""
}

return h.user.Scope
}

0 comments on commit 8a32e9a

Please sign in to comment.