From e509abffee37333b3629a823027de17374d85272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 19 Dec 2018 13:48:13 +0100 Subject: [PATCH] MOBILE-2795 course: Fix undefined section modules length --- src/core/course/providers/helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/course/providers/helper.ts b/src/core/course/providers/helper.ts index 73ac7e3a4..6bbc497a8 100644 --- a/src/core/course/providers/helper.ts +++ b/src/core/course/providers/helper.ts @@ -1083,7 +1083,7 @@ export class CoreCourseHelperProvider { } const sectionWithModules = sections.find((section) => { - return section.modules.length > 0; + return section.modules && section.modules.length > 0; }); if (!sectionWithModules || typeof sectionWithModules.modules[0].completion == 'undefined') { promises.push(this.courseProvider.getActivitiesCompletionStatus(course.id));