Skip to content

Commit

Permalink
fix(auth): null-check username when getting current user (#1490)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphkim authored Sep 9, 2021
1 parent 1638924 commit 76c2b0f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ public void onError(Exception error) {

@Override
public AuthUser getCurrentUser() {
if (userId != null) {
if (userId != null && awsMobileClient.getUsername() != null) {
return new AuthUser(userId, awsMobileClient.getUsername());
} else {
return null;
Expand Down

0 comments on commit 76c2b0f

Please sign in to comment.