mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-26 06:43:45 +03:00
Don't crash on ill-formed URLs (#1084)
(cherry picked from commit 854474f85ffc41eccdc2b3a6cf105fa2805ebc3c)
This commit is contained in:
parent
965772300a
commit
f09e563359
1 changed files with 5 additions and 3 deletions
|
@ -11,7 +11,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.anime.service.AnimeSourceManager
|
import tachiyomi.domain.source.anime.service.AnimeSourceManager
|
||||||
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
import tachiyomi.domain.source.manga.service.MangaSourceManager
|
||||||
|
@ -57,7 +57,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 a new issue