add trap for potential async context issue found by linter

This commit is contained in:
stopflock
2026-07-26 04:05:54 -05:00
parent c787589205
commit 0c6cf467fe
@@ -25,6 +25,7 @@ class EnableOfflineFeaturesSection extends StatelessWidget {
// no "cancel" path once this dialog is shown. // no "cancel" path once this dialog is shown.
final offlineService = OfflineAreaService(); final offlineService = OfflineAreaService();
await offlineService.ensureInitialized(); await offlineService.ensureInitialized();
if (!context.mounted) return;
final hasExistingAreas = offlineService.offlineAreas.isNotEmpty; final hasExistingAreas = offlineService.offlineAreas.isNotEmpty;
if (!hasExistingAreas) { if (!hasExistingAreas) {