From 9e64bd13071d49aa373b3630a69833bed0f21903 Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Fri, 9 Mar 2018 19:54:24 +0100 Subject: [PATCH] fix crash in LoginActivity --- app/src/main/java/com/keylesspalace/tusky/LoginActivity.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/LoginActivity.kt b/app/src/main/java/com/keylesspalace/tusky/LoginActivity.kt index fb303a52..46778dcf 100644 --- a/app/src/main/java/com/keylesspalace/tusky/LoginActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/LoginActivity.kt @@ -215,11 +215,12 @@ class LoginActivity : AppCompatActivity() { val code = uri.getQueryParameter("code") val error = uri.getQueryParameter("error") - if (code != null) { + domain = preferences.getString(DOMAIN, "") + + if (code != null && domain.isNotEmpty()) { /* During the redirect roundtrip this Activity usually dies, which wipes out the * instance variables, so they have to be recovered from where they were saved in * SharedPreferences. */ - domain = preferences.getString(DOMAIN, null) clientId = preferences.getString(CLIENT_ID, null) clientSecret = preferences.getString(CLIENT_SECRET, null)