mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-11-29 02:42:51 +00:00
fix error with null user when api throw apikey
This commit is contained in:
parent
599686ea34
commit
5c25855635
1 changed files with 3 additions and 0 deletions
|
|
@ -87,6 +87,9 @@ func (a *InboundController) initRouter(g *gin.RouterGroup) {
|
|||
// getInbounds retrieves the list of inbounds for the logged-in user.
|
||||
func (a *InboundController) getInbounds(c *gin.Context) {
|
||||
user := session.GetLoginUser(c)
|
||||
if user == nil {
|
||||
user.Id = 1
|
||||
}
|
||||
inbounds, err := a.inboundService.GetInbounds(user.Id)
|
||||
if err != nil {
|
||||
jsonMsg(c, I18nWeb(c, "pages.inbounds.toasts.obtain"), err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue