MOBILE-3010 resource: Fix error if no mimetype
parent
38a7dd355e
commit
1f42ea990a
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue