diff --git a/register.go b/register.go index 515bf70..cfba425 100644 --- a/register.go +++ b/register.go @@ -96,11 +96,8 @@ func registerSubmit(c *gin.Context) { errr := db.QueryRow("SELECT id FROM beta_keys WHERE key_md5 = ? AND allowed = 1", cmd5(c.PostForm("key"))) fmt.Printf("%v", errr) - for errr.Next() { - i++ - } - if i == 0 { - registerResp(c, errorMessage{T(c, "Invalid Beta Key.")}) + if err.Scan(new(int)) == sql.ErrNoRows { + registerResp(c, errorMessage{T(c, "key bad.")}) return }