diff --git a/lib/screens/explore_screens/regions_screens/regions_main/interactor/viewmodel/region_bloc.dart b/lib/screens/explore_screens/regions_screens/regions_main/interactor/viewmodel/region_bloc.dart index 369862860..0fb68dc77 100644 --- a/lib/screens/explore_screens/regions_screens/regions_main/interactor/viewmodel/region_bloc.dart +++ b/lib/screens/explore_screens/regions_screens/regions_main/interactor/viewmodel/region_bloc.dart @@ -48,9 +48,13 @@ class RegionBloc extends Bloc { pageCommand: NavigateToRouteWithArguments(route: Routes.createRegionEvent, arguments: state.region))); } - Stream> get regionMessages => _firebaseRepository.getMessagesForRegion(state.region!.id); + Stream> get regionMessages { + return state.region != null ? _firebaseRepository.getMessagesForRegion(state.region!.id) : const Stream.empty(); + } - Stream> get regionEvents => _firebaseRepository.getEventsForRegion(state.region!.id); + Stream> get regionEvents { + return state.region != null ? _firebaseRepository.getEventsForRegion(state.region!.id) : const Stream.empty(); + } Future _onRegionMounted(OnRegionMounted event, Emitter emit) async { if (state.region == null) {