diff --git a/src/addons/mod/url/services/handlers/module.ts b/src/addons/mod/url/services/handlers/module.ts index c08f09595..b0c0f8be3 100644 --- a/src/addons/mod/url/services/handlers/module.ts +++ b/src/addons/mod/url/services/handlers/module.ts @@ -150,11 +150,7 @@ export class AddonModUrlModuleHandlerService extends CoreModuleHandlerBase imple } } - if (!mainFile) { - return; - } - - const icon = AddonModUrl.guessIcon(mainFile.fileurl); + const icon = mainFile? AddonModUrl.guessIcon(mainFile.fileurl) : undefined; // Calculate the icon to use. return CoreCourse.getModuleIconSrc(module.modname, module.modicon, icon);