Skip to content

armgit / ente

Public Imported from GitHub
0

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

Guard init callbacks after dispose

Neeraj Guptaab2a246ae4ac
diff --git a/mobile/apps/photos/lib/ui/account/sessions_page.dart b/mobile/apps/photos/lib/ui/account/sessions_page.dart
index ce2e52fa6c..1e3e265328 100644
--- a/mobile/apps/photos/lib/ui/account/sessions_page.dart
+++ b/mobile/apps/photos/lib/ui/account/sessions_page.dart
@@ -25,6 +25,7 @@ class _SessionsPageState extends State<SessionsPage> {
@override
void initState() {
_fetchActiveSessions().onError((error, stackTrace) {
+ if (!mounted) return;
showToast(
context,
AppLocalizations.of(context).failedToFetchActiveSessions,
diff --git a/mobile/apps/photos/lib/ui/viewer/search_tab/contacts_section.dart b/mobile/apps/photos/lib/ui/viewer/search_tab/contacts_section.dart
index e7ccc33223..17baf3674f 100644
--- a/mobile/apps/photos/lib/ui/viewer/search_tab/contacts_section.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search_tab/contacts_section.dart
@@ -107,6 +107,7 @@ class _ContactsSectionState extends State<ContactsSection> {
limit: widget.resultLimit + 1,
))
as List<GenericSearchResult>;
+ if (!mounted) return;
setState(() {});
});
}),