Skip to content

armgit / ente

Public Imported from GitHub
0

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

Guard recovery navigation after async lookup

AmanRajSinghMourya06eed0c3e58d
diff --git a/mobile/packages/legacy/lib/pages/other_contact_page.dart b/mobile/packages/legacy/lib/pages/other_contact_page.dart
index 9a296be2ff..0bafea3591 100644
--- a/mobile/packages/legacy/lib/pages/other_contact_page.dart
+++ b/mobile/packages/legacy/lib/pages/other_contact_page.dart
@@ -182,12 +182,20 @@ class _OtherContactPageState extends State<OtherContactPage> {
) = await EmergencyContactService.instance.getRecoveryInfo(
recoverySession!,
);
+ if (!context.mounted) {
+ return;
+ }
routeToPage(
context,
RecoverOthersAccount(key, attributes, recoverySession!),
).ignore();
} catch (e) {
- showGenericErrorDialog(context: context, error: e).ignore();
+ if (context.mounted) {
+ showGenericErrorDialog(
+ context: context,
+ error: e,
+ ).ignore();
+ }
}
},
),