Skip to content

Check mEmail for empty String to prevent "credential identifier cannot be empty" error #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected void onStart() {

@Override
public void onConnected(@Nullable Bundle bundle) {
if (mEmail == null) {
if (mEmail == null || mEmail.equals("")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be replaced with TextUtils.isEmpty(mEmail)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should investigate under what circumstances a null / empty email address ever arrives here. I agree with sam however that if (TextUtils.isEmpty(mEmail) is a more descriptive check here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty email issue happens due to privacy setting of some users, where you get name and profile image but email is null

Log.e(TAG, "Unable to save null credential!");
finish(RESULT_FIRST_USER, getIntent());
return;
Expand Down