Skip to content

Commit ac3979b

Browse files
committed
chore: add guard to the context usage
1 parent dff0e53 commit ac3979b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/app/services/ui_event_queue/ui_event_queue_notifier.r.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ class UiEventQueueNotifier extends _$UiEventQueueNotifier {
4848
while (state.isNotEmpty) {
4949
final event = state.first;
5050
try {
51-
await event.performAction(rootNavigatorKey.currentContext!);
51+
final context = rootNavigatorKey.currentContext;
52+
if (context != null && context.mounted) {
53+
await event.performAction(context);
54+
}
5255
} catch (error, stackTrace) {
5356
Logger.error(error, stackTrace: stackTrace);
5457
} finally {

0 commit comments

Comments
 (0)