Skip to content

Commit

Permalink
Merge pull request #34 from batshalregmi/viveknewfixes
Browse files Browse the repository at this point in the history
fixed broken email change
  • Loading branch information
vivek3210 authored Apr 21, 2024
2 parents f2dde97 + cc77563 commit d7f4b79
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.json.JSONObject;

import java.io.IOException;
import java.util.Objects;

public class SettingsActivity extends AppCompatActivity {
Dialog passwordDialog;
Expand Down Expand Up @@ -146,7 +147,7 @@ public void onClick(View v) {
EditText newEmail = emailDialog.findViewById(R.id.newEmail);
changeEmailButton.setOnClickListener(x -> {
FirebaseAuth user = FirebaseAuth.getInstance();
user.getCurrentUser().updateEmail(newEmail.getText().toString())
Objects.requireNonNull(user.getCurrentUser()).updateEmail(newEmail.getText().toString())
.addOnCompleteListener(task -> {
if (task.isSuccessful()) {
Log.d("SettingsActivity", "User email address updated.");
Expand Down

0 comments on commit d7f4b79

Please sign in to comment.