Skip to content

Commit ba763ec

Browse files
Merge pull request #30 from CS3219-AY2425S1/edit-profile-fix-bug
2 parents e84cf61 + c3dd6a8 commit ba763ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Frontend/src/components/user/EditProfile.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function EditProfile() {
5151
const usernameRegex = /^[a-zA-Z0-9._]{3,20}$/;
5252
const isValidUsername = usernameRegex.test(username)
5353

54-
if(!isValidUsername) {
54+
if(!isValidUsername && username !== "") {
5555
console.log("username is not valid:", username)
5656
setUsernameError(true)
5757
setErrorMessage("Username can only contain letters, numbers, dots (.), and underscores (_), and must be between 3 and 20 characters long.")

0 commit comments

Comments
 (0)