From ad304fab5af7a83df94fda9c3ad4b6c71d00bf13 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 17 Sep 2020 09:56:38 +0200 Subject: [PATCH] MOBILE-3530 course: Fix error when removing course files with site plugins --- src/core/course/providers/module-prefetch-delegate.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/course/providers/module-prefetch-delegate.ts b/src/core/course/providers/module-prefetch-delegate.ts index 462f7ce83..53a236b09 100644 --- a/src/core/course/providers/module-prefetch-delegate.ts +++ b/src/core/course/providers/module-prefetch-delegate.ts @@ -730,10 +730,10 @@ export class CoreCourseModulePrefetchDelegate extends CoreDelegate { getModuleFiles(module: any, courseId: number): Promise { 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;