From e02cf0f2d1e1e8aa8fd561d59f6c12c9e16f1ba6 Mon Sep 17 00:00:00 2001 From: Mohamed Zenadi Date: Sat, 20 Jun 2015 17:07:24 +0200 Subject: fix an NPE that happens when the user tries to save git settings --- app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/src/main') diff --git a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java index 54e192cc..aaa058ec 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java @@ -414,6 +414,12 @@ public class GitActivity extends AppCompatActivity { editor.putString("git_remote_protocol", protocol); editor.putString("git_remote_auth", connectionMode); editor.putString("git_remote_port", ((EditText) findViewById(R.id.server_port)).getText().toString()); + editor.putString("git_remote_uri", ((EditText) findViewById(R.id.clone_uri)).getText().toString()); + + if (PasswordRepository.isInitialized()) { + PasswordRepository.addRemote("origin", ((EditText) findViewById(R.id.clone_uri)).getText().toString(), true); + } + editor.apply(); } @@ -424,7 +430,6 @@ public class GitActivity extends AppCompatActivity { */ public void saveConfiguration(View view) { saveConfiguration(); - PasswordRepository.addRemote("origin", ((EditText) findViewById(R.id.clone_uri)).getText().toString(), true); finish(); } -- cgit v1.2.3