Skip to content

Commit

Permalink
Fixed clearcookies crash when URL is a blob
Browse files Browse the repository at this point in the history
  • Loading branch information
Saud-97 committed Nov 10, 2023
1 parent a47a223 commit 8fa2baf
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,13 @@ open class WebViewActivity : BaseWebViewActivity() {

private fun clearCookies() {
val url = binding.webview.url ?: return
val cleared = network.cookieJar.remove(url.toHttpUrl())
toast("Cleared $cleared cookies for: $url")
try {
val cleared = network.cookieJar.remove(url.toHttpUrl())
toast("Cleared $cleared cookies for: $url")
} catch (e: Exception) {
Timber.e(e)
toast("$e")
}
}

private fun openUrlInApp() {
Expand Down

0 comments on commit 8fa2baf

Please sign in to comment.