Return without setting the flag that's already set

This commit is contained in:
Alfred Kamanda 2024-08-29 22:54:52 +03:00
parent 3da2949d38
commit 1a7c992e5b
Signed by untrusted user: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -89,10 +89,9 @@ func (h *Handlers) CreateAccount(ctx context.Context, sym string, input []byte)
return res, err
}
// if an account exists, set the flag and return
// if an account exists, return to prevent duplicate account creation
existingAccountData, err := h.accountFileHandler.ReadAccountData()
if existingAccountData != nil {
res.FlagSet = append(res.FlagSet, models.USERFLAG_ACCOUNT_CREATED)
return res, err
}