diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoreLoginActivity.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoreLoginActivity.kt index a6b0253bd..b7ffa3fbd 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoreLoginActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoreLoginActivity.kt @@ -287,7 +287,7 @@ class StoreLoginActivity : ComponentActivity() { private fun settle(problem: String?) { runOnUiThread { - if (problem == null) { StoresState.refresh(this); finish(); return } + if (problem == null) { StoresState.refresh(this); finish(); return@runOnUiThread } captured.set(false) if (!isFinishing && !isDestroyed) android.widget.Toast.makeText(this, problem, android.widget.Toast.LENGTH_LONG).show() reloadLogin() diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoreNet.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoreNet.kt index 109e4f6a4..193b5d432 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoreNet.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoreNet.kt @@ -106,9 +106,11 @@ object StoreLog { fun redactUrl(url: String?): String? { if (url == null) return null return try { - var out = url - out.indexOf('#').takeIf { it >= 0 }?.let { out = out.substring(0, it) } - out.indexOf('?').takeIf { it >= 0 }?.let { out = out.substring(0, it) } + var out: String = url + val hash = out.indexOf('#') + if (hash >= 0) out = out.substring(0, hash) + val q = out.indexOf('?') + if (q >= 0) out = out.substring(0, q) val scheme = out.indexOf("://") if (scheme >= 0) { val authStart = scheme + 3