From 145c6a8acb5ccac2dd29cf751476a0600f123c4e Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Tue, 17 Apr 2018 20:51:33 +0200 Subject: [PATCH] strip slashes from instance domain to avoid crash --- app/src/main/java/com/keylesspalace/tusky/LoginActivity.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/com/keylesspalace/tusky/LoginActivity.kt b/app/src/main/java/com/keylesspalace/tusky/LoginActivity.kt index 58249b89..9460918f 100644 --- a/app/src/main/java/com/keylesspalace/tusky/LoginActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/LoginActivity.kt @@ -320,6 +320,10 @@ class LoginActivity : AppCompatActivity() { // Strip any schemes out. var s = domain.replaceFirst("http://", "") s = s.replaceFirst("https://", "") + + //strip out any slashes that might have been added + s = s.replace("/", "") + // If a username was included (e.g. username@example.com), just take what's after the '@'. val at = s.lastIndexOf('@') if (at != -1) {