diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewScreenModel.kt index 38dca6ac3..af5eadad6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewScreenModel.kt @@ -11,7 +11,7 @@ import eu.kanade.tachiyomi.util.system.openInBrowser import eu.kanade.tachiyomi.util.system.toShareIntent import eu.kanade.tachiyomi.util.system.toast import logcat.LogPriority -import okhttp3.HttpUrl.Companion.toHttpUrl +import okhttp3.HttpUrl.Companion.toHttpUrlOrNull import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.source.anime.service.AnimeSourceManager import tachiyomi.domain.source.manga.service.MangaSourceManager @@ -57,7 +57,9 @@ class WebViewScreenModel( } fun clearCookies(url: String) { - val cleared = network.cookieJar.remove(url.toHttpUrl()) - logcat { "Cleared $cleared cookies for: $url" } + url.toHttpUrlOrNull()?.let { + val cleared = network.cookieJar.remove(it) + logcat { "Cleared $cleared cookies for: $url" } + } } }