Update detekt and fix minor warnings (#955)

This commit is contained in:
David Perez
2024-02-05 15:34:26 -06:00
committed by Álison Fernandes
parent 28f805418d
commit 61212c3628
5 changed files with 6 additions and 60 deletions

View File

@@ -18,5 +18,6 @@ inline fun <reified T> Intent.getSafeParcelableExtra(name: String): T? =
T::class.java,
)
} else {
@Suppress("DEPRECATION")
getParcelableExtra(name)
}

View File

@@ -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,