From bc33ae3bf809b8d03f85b3675e36732aeb674771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 4 Dec 2019 15:07:22 +0100 Subject: [PATCH] MOBILE-3217 course: Check colors array is populated --- src/core/courses/providers/helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/courses/providers/helper.ts b/src/core/courses/providers/helper.ts index b918d3b1c..0d98fe61e 100644 --- a/src/core/courses/providers/helper.ts +++ b/src/core/courses/providers/helper.ts @@ -143,7 +143,7 @@ export class CoreCoursesHelperProvider { this.loadCourseExtraInfo(course, courseInfoAvailable ? coursesInfo[course.id] : course, loadCategoryNames); if (!course.courseImage) { course.colorNumber = course.id % 10; - course.color = colors[course.colorNumber]; + course.color = colors.length && colors[course.colorNumber]; } }); });