Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mobile][photos] use stable navigator context for error dialog after pop

r4khul55093fb01d7b
diff --git a/mobile/apps/photos/lib/ui/payment/payment_web_page.dart b/mobile/apps/photos/lib/ui/payment/payment_web_page.dart
index ea0c822ce1..ca55e613f1 100644
--- a/mobile/apps/photos/lib/ui/payment/payment_web_page.dart
+++ b/mobile/apps/photos/lib/ui/payment/payment_web_page.dart
@@ -101,9 +101,11 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
if (navigationAction.isForMainFrame == true &&
error.type != WebResourceErrorType.CANCELLED) {
if (!mounted) return;
- Navigator.of(context).pop(false);
+ final navigator = Navigator.of(context);
+ navigator.pop(false);
+ if (!navigator.mounted) return;
await showGenericErrorDialog(
- context: context,
+ context: navigator.context,
error: error,
);
}