Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Jul 31, 2020
1 parent 989671d commit 2af17a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions trojan/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ func GenClientJson() {
var user core.User
domain, port := GetDomainAndPort()
mysql := core.GetMysql()
userList := mysql.GetData()
if userList == nil {
fmt.Println("连接mysql失败!")
userList, err := mysql.GetData()
if err != nil {
fmt.Println(err.Error())
return
}
if len(userList) == 1 {
Expand Down
2 changes: 1 addition & 1 deletion trojan/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func InstallMysql() {
}
mysql.CreateTable()
core.WriteMysql(&mysql)
if len(mysql.GetData()) == 0 {
if userList, _ := mysql.GetData(); len(userList) == 0 {
AddUser()
}
Restart()
Expand Down

0 comments on commit 2af17a0

Please sign in to comment.