Avoid crashing during eager WebView init

(cherry picked from commit fbda243c0d)
This commit is contained in:
arkon
2022-10-21 16:57:13 -04:00
committed by Jobobby04
parent d0f3bd077c
commit 26be340cd0
@@ -38,7 +38,11 @@ abstract class WebViewInterceptor(private val context: Context) : Interceptor {
return@lazy
}
WebSettings.getDefaultUserAgent(context)
try {
WebSettings.getDefaultUserAgent(context)
} catch (_: Exception) {
// Avoid some crashes like when Chrome/WebView is being updated.
}
}
abstract fun shouldIntercept(response: Response): Boolean