diff --git a/src/components/FancyTree/index.vue b/src/components/FancyTree/index.vue index 29a62f5..a294b3e 100644 --- a/src/components/FancyTree/index.vue +++ b/src/components/FancyTree/index.vue @@ -458,18 +458,20 @@ if(file.isFolder){ return 'folder' } - if(file.contentType.indexOf('video') > -1){ - return 'video' - } - if(file.contentType.startsWith('image')){ - return 'image' - } - if(file.contentType.indexOf('audio') > -1){ - return 'audio' + if (file.contentType) { + if(file.contentType.indexOf('video') > -1){ + return 'video' + } + if(file.contentType.startsWith('image')){ + return 'image' + } + if(file.contentType.indexOf('audio') > -1){ + return 'audio' + } } let suffix = file.suffix; if(!suffix && file.name){ - suffix = file.name.substring(file.name.lastIndexOf('.') + 1); + suffix = file.name.substring(file.name.lastIndexOf('.') + 1) } if(iconClass.has(suffix)){ return iconClass.get(suffix)