MOBILE-3010 resource: Fix error if no mimetype

main
Dani Palou 2019-05-08 12:05:36 +02:00
parent 38a7dd355e
commit 1f42ea990a
1 changed files with 3 additions and 1 deletions

View File

@ -175,7 +175,9 @@ export class AddonModResourceModuleHandler implements CoreCourseModuleHandler {
if (module.contentsinfo) {
// No need to use the list of files.
const mimetype = module.contentsinfo.mimetypes[0];
resourceData.icon = this.mimetypeUtils.getMimetypeIcon(mimetype);
if (mimetype) {
resourceData.icon = this.mimetypeUtils.getMimetypeIcon(mimetype);
}
resourceData.extra = this.textUtils.cleanTags(module.afterlink);
} else if (files && files.length) {