MOBILE-2858 courses: Do not check course options on empty list

main
Pau Ferrer Ocaña 2019-02-01 11:51:36 +01:00
parent 442c184ac0
commit e891fcb1a1
1 changed files with 8 additions and 0 deletions

View File

@ -555,6 +555,10 @@ export class CoreCoursesProvider {
* @return {Promise<any>} Promise resolved with administration options for each course.
*/
getUserAdministrationOptions(courseIds: number[], siteId?: string): Promise<any> {
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<any>} Promise resolved with navigation options for each course.
*/
getUserNavigationOptions(courseIds: number[], siteId?: string): Promise<any> {
if (!courseIds || courseIds.length == 0) {
return Promise.resolve({});
}
return this.sitesProvider.getSite(siteId).then((site) => {
const params = {
courseids: courseIds