Fix GET users with no users

This commit is contained in:
daru committed 2022-04-17 19:52:00 +02:00
1 parent f802dda91c
commit 39aae626d3
1 file changed
+6 -2
+6 -2
View File
@@ -110,8 +110,12 @@ func UserGet(ctx *fasthttp.RequestCtx) {
} else {
regUsers, err := ReadRegisteredUsers()
if err != nil {
addErrorToCtx(ctx, err)
return
// check if no users registered
if err != nutsdb.ErrBucketEmpty {
addErrorToCtx(ctx, err)
return
}
regUsers = make([]UserData, 0)
}
for _, u := range regUsers {
user, _, err := GetUserData(u.Username)