Fix helper panic (#676)

Fix helper on get login struct

Reviewed-on: https://gitea.com/gitea/tea/pulls/676
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com>
Co-authored-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com>
Co-committed-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com>
This commit is contained in:
Matheus Sampaio Queiroga
2025-02-26 16:09:06 +00:00
committed by techknowlogick
parent fe1928679a
commit c2ddda6800
2 changed files with 9 additions and 18 deletions

View File

@ -91,7 +91,9 @@ var CmdLoginHelper = cli.Command{
}
userConfig := config.GetLoginByHost(wants["host"])
if len(userConfig.Token) == 0 {
if userConfig == nil {
log.Fatal("host not exists")
} else if len(userConfig.Token) == 0 {
log.Fatal("User no set")
}