Skip to content

Commit df33e2b

Browse files
committed
(fix) media type check
1 parent 69e2605 commit df33e2b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/utils/media-file.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { IMAGE_TYPES, VIDEO_TYPES, AUDIO_TYPES } from './constants'
22

33
function checkMediaType(types, file) {
4-
if (!file) return
5-
const { type } = file
6-
return types.some(t => type.toLowerCase().includes(t))
4+
if (!file || !file.type) return
5+
return types.some(t => file.type.toLowerCase().includes(t))
76
}
87

98
export function isImageFile(file) {

0 commit comments

Comments
 (0)