mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Fix a crash that could occur in the incognito browser
This commit is contained in:
		@@ -159,8 +159,14 @@ class WebViewActivity : BaseActivity() {
 | 
			
		||||
            android.R.id.home -> finish()
 | 
			
		||||
            R.id.action_refresh -> webview.reload()
 | 
			
		||||
            R.id.action_forward -> webview.goForward()
 | 
			
		||||
            R.id.action_open_in_browser ->
 | 
			
		||||
                startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(webview.url)))
 | 
			
		||||
            R.id.action_open_in_browser -> {
 | 
			
		||||
                val url = webview.url
 | 
			
		||||
                if(url != null) {
 | 
			
		||||
                    startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
 | 
			
		||||
                } else {
 | 
			
		||||
                    toast("An error occurred while opening this page in your browser!")
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return super.onOptionsItemSelected(item)
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user