fix: add try-catch to _measureHeight() in secure_email_webview.dart (#345)
This commit was merged in pull request #345.
This commit is contained in:
@@ -111,6 +111,7 @@ class _SecureEmailWebViewState extends State<SecureEmailWebView> {
|
||||
);
|
||||
|
||||
Future<void> _measureHeight(String _) async {
|
||||
try {
|
||||
final result = await _controller!.runJavaScriptReturningResult(
|
||||
'document.documentElement.scrollHeight',
|
||||
);
|
||||
@@ -118,6 +119,9 @@ class _SecureEmailWebViewState extends State<SecureEmailWebView> {
|
||||
if (h != null && h > 0 && mounted) {
|
||||
setState(() => _height = h);
|
||||
}
|
||||
} catch (_) {
|
||||
// WebView not ready yet; height stays at default
|
||||
}
|
||||
}
|
||||
|
||||
NavigationDecision _handleNavigation(NavigationRequest req) {
|
||||
|
||||
Reference in New Issue
Block a user