mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-10 04:37:25 +01:00
Don't crash on ill-formed URLs (#1084)
This commit is contained in:
parent
04db46fe75
commit
854474f85f
@ -10,7 +10,7 @@ import eu.kanade.tachiyomi.util.system.openInBrowser
|
|||||||
import eu.kanade.tachiyomi.util.system.toShareIntent
|
import eu.kanade.tachiyomi.util.system.toShareIntent
|
||||||
import eu.kanade.tachiyomi.util.system.toast
|
import eu.kanade.tachiyomi.util.system.toast
|
||||||
import logcat.LogPriority
|
import logcat.LogPriority
|
||||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
||||||
import tachiyomi.core.common.util.system.logcat
|
import tachiyomi.core.common.util.system.logcat
|
||||||
import tachiyomi.domain.source.service.SourceManager
|
import tachiyomi.domain.source.service.SourceManager
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
@ -47,7 +47,9 @@ class WebViewScreenModel(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun clearCookies(url: String) {
|
fun clearCookies(url: String) {
|
||||||
val cleared = network.cookieJar.remove(url.toHttpUrl())
|
url.toHttpUrlOrNull()?.let {
|
||||||
logcat { "Cleared $cleared cookies for: $url" }
|
val cleared = network.cookieJar.remove(it)
|
||||||
|
logcat { "Cleared $cleared cookies for: $url" }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user