Commit 867e76f78366d5f9086204317b670dc58c6ab261
Merge branch 'feat-wqf-payment' into ios_umeng
Showing
1 changed file
with
6 additions
and
3 deletions
lib/pages/section/bloc/section_bloc.dart
... | ... | @@ -67,9 +67,12 @@ class SectionBloc extends Bloc<SectionEvent, SectionState> { |
67 | 67 | RequestDataEvent event, Emitter<SectionState> emitter) async { |
68 | 68 | try { |
69 | 69 | await loading(() async { |
70 | - _courseSectionDatasMap[event.courseUnitId] = | |
71 | - await LessonDao.courseSection(courseUnitId: event.courseUnitId); | |
72 | - emitter(LessonDataLoadState()); | |
70 | + List<CourseSectionEntity>? courseSectionEntities = await LessonDao.courseSection(courseUnitId: event.courseUnitId); | |
71 | + if (courseSectionEntities != null) { | |
72 | + _courseSectionDatasMap[event.courseUnitId] = | |
73 | + await LessonDao.courseSection(courseUnitId: event.courseUnitId); | |
74 | + emitter(LessonDataLoadState()); | |
75 | + } | |
73 | 76 | }); |
74 | 77 | } catch (e) { |
75 | 78 | if (e is ApiException) { | ... | ... |