aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/com/zeapo
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-04-21 15:36:30 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-04-21 15:36:30 +0530
commit77096c1702238301524664cfb6590a5ab4ff272c (patch)
tree93b32ab2cd9e65467210a5ddf5f46a3ddc10b090 /app/src/main/java/com/zeapo
parent47c2875e931a1cd0389d3d21e110beb3a65c0f53 (diff)
BaseGitActivity: don't remove saved password unnecessarily
if previousUrl is empty it means that this the first time the method is being called, and url has not been built yet. We let things slide for the first pass so that the actual logic only kicks in when it needs to. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java/com/zeapo')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/git/BaseGitActivity.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/git/BaseGitActivity.kt b/app/src/main/java/com/zeapo/pwdstore/git/BaseGitActivity.kt
index 2cfeebae..4d5ef66a 100644
--- a/app/src/main/java/com/zeapo/pwdstore/git/BaseGitActivity.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/git/BaseGitActivity.kt
@@ -126,7 +126,7 @@ abstract class BaseGitActivity : AppCompatActivity() {
PasswordRepository.addRemote("origin", newUrl, true)
// HTTPS authentication sends the password to the server, so we must wipe the password when
// the server is changed.
- if (newUrl != previousUrl && protocol == Protocol.Https)
+ if (previousUrl.isNotEmpty() && newUrl != previousUrl && protocol == Protocol.Https)
encryptedSettings.edit { remove("https_password") }
url = newUrl
return true