Merge pull request #2537 from dpalou/MOBILE-3530

MOBILE-3530 course: Fix error when removing course files with site pl…
main
Juan Leyva 2020-09-22 13:29:42 +02:00 committed by GitHub
commit 7d48aa1cd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -730,10 +730,10 @@ export class CoreCourseModulePrefetchDelegate extends CoreDelegate {
getModuleFiles(module: any, courseId: number): Promise<any[]> {
const handler = this.getPrefetchHandlerFor(module);
if (handler.getFiles) {
if (handler && handler.getFiles) {
// The handler defines a function to get files, use it.
return Promise.resolve(handler.getFiles(module, courseId));
} else if (handler.loadContents) {
} else if (handler && handler.loadContents) {
// The handler defines a function to load contents, use it before returning module contents.
return handler.loadContents(module, courseId).then(() => {
return module.contents;