mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-11-29 02:42:51 +00:00
try skip UserId if this nil
This commit is contained in:
parent
f02bddd1fe
commit
6b9005d1f2
1 changed files with 5 additions and 1 deletions
|
|
@ -141,7 +141,11 @@ func (a *InboundController) addInbound(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
user := session.GetLoginUser(c)
|
user := session.GetLoginUser(c)
|
||||||
inbound.UserId = user.Id
|
// since the request came through the API without a login and session, we don't know what to do with the UserId here
|
||||||
|
// and it's unclear why it's needed in this place anyway
|
||||||
|
if user != nil {
|
||||||
|
inbound.UserId = user.Id
|
||||||
|
}
|
||||||
if inbound.Listen == "" || inbound.Listen == "0.0.0.0" || inbound.Listen == "::" || inbound.Listen == "::0" {
|
if inbound.Listen == "" || inbound.Listen == "0.0.0.0" || inbound.Listen == "::" || inbound.Listen == "::0" {
|
||||||
inbound.Tag = fmt.Sprintf("inbound-%v", inbound.Port)
|
inbound.Tag = fmt.Sprintf("inbound-%v", inbound.Port)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue