Avoid crashing during eager WebView init
(cherry picked from commit fbda243c0d8477da18c39a12327e1b98d57093fe)
This commit is contained in:
parent
d0f3bd077c
commit
26be340cd0
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue