mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Avoid crashing during eager WebView init
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user