Fixed invalid return in AmGetUserByName when user does not exist. Closes issue #1.

This commit is contained in:
2026-02-07 22:07:03 -07:00
parent f70746c4dd
commit 77bd541546
+2
View File
@@ -443,6 +443,8 @@ func AmGetUserByName(ctx context.Context, name string, tx *sqlx.Tx) (*User, erro
}
if len(dbdata) > 1 {
return nil, fmt.Errorf("AmGetUserByName(\"%s\"): too many responses(%d)", name, len(dbdata))
} else if len(dbdata) == 0 {
return nil, errors.New("user not found")
}
getUserMutex.Lock()
rc, ok := userCache.Get(dbdata[0].Uid)