diff --git a/src/core/courses/providers/courses.ts b/src/core/courses/providers/courses.ts index 548069d07..d4e492aa8 100644 --- a/src/core/courses/providers/courses.ts +++ b/src/core/courses/providers/courses.ts @@ -555,6 +555,10 @@ export class CoreCoursesProvider { * @return {Promise} Promise resolved with administration options for each course. */ getUserAdministrationOptions(courseIds: number[], siteId?: string): Promise { + if (!courseIds || courseIds.length == 0) { + return Promise.resolve({}); + } + return this.sitesProvider.getSite(siteId).then((site) => { const params = { courseids: courseIds @@ -597,6 +601,10 @@ export class CoreCoursesProvider { * @return {Promise} Promise resolved with navigation options for each course. */ getUserNavigationOptions(courseIds: number[], siteId?: string): Promise { + if (!courseIds || courseIds.length == 0) { + return Promise.resolve({}); + } + return this.sitesProvider.getSite(siteId).then((site) => { const params = { courseids: courseIds