fix error with null user when api throw apikey

This commit is contained in:
Дмитрий Саенко 2025-10-28 09:07:34 +03:00
parent 599686ea34
commit 5c25855635

View file

@ -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)