mirror of
https://github.com/bitwarden/android.git
synced 2026-06-04 11:46:51 -05:00
Update detekt and fix minor warnings (#955)
This commit is contained in:
committed by
Álison Fernandes
parent
28f805418d
commit
61212c3628
@@ -18,5 +18,6 @@ inline fun <reified T> Intent.getSafeParcelableExtra(name: String): T? =
|
||||
T::class.java,
|
||||
)
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
getParcelableExtra(name)
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ private const val IP_REGEX: String =
|
||||
* Parses the base domain from the URL. Returns null if unavailable.
|
||||
*/
|
||||
fun URI.parseDomainOrNull(context: Context): String? {
|
||||
val host = this?.host ?: return null
|
||||
val host = this.host ?: return null
|
||||
val isIpAddress = host.matches(IP_REGEX.toRegex())
|
||||
|
||||
return if (host == "localhost" || isIpAddress) {
|
||||
@@ -38,7 +38,7 @@ fun URI.parseDomainOrNull(context: Context): String? {
|
||||
fun URI.parseDomainNameOrNull(context: Context): DomainName? =
|
||||
this
|
||||
// URI is a platform type and host can be null.
|
||||
?.host
|
||||
.host
|
||||
?.let { nonNullHost ->
|
||||
parseDomainNameOrNullInternal(
|
||||
context = context,
|
||||
|
||||
Reference in New Issue
Block a user