Skip to content

Commit 76c2b0f

Browse files
authored
fix(auth): null-check username when getting current user (#1490)
1 parent 1638924 commit 76c2b0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aws-auth-cognito/src/main/java/com/amplifyframework/auth/cognito/AWSCognitoAuthPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ public void onError(Exception error) {
10531053

10541054
@Override
10551055
public AuthUser getCurrentUser() {
1056-
if (userId != null) {
1056+
if (userId != null && awsMobileClient.getUsername() != null) {
10571057
return new AuthUser(userId, awsMobileClient.getUsername());
10581058
} else {
10591059
return null;

0 commit comments

Comments
 (0)