fiox typeParts undefined check

This commit is contained in:
Abhinav-grd 2021-08-18 17:46:20 +05:30
parent 16e287d1ce
commit b67a7a9401

View file

@ -23,7 +23,7 @@ export async function getFileType(
let fileType: FILE_TYPE; let fileType: FILE_TYPE;
const mimeType = await getMimeType(worker, receivedFile); const mimeType = await getMimeType(worker, receivedFile);
const typeParts = mimeType?.split('/'); const typeParts = mimeType?.split('/');
if (typeParts?.length < 2) { if (typeParts?.length !== 2) {
return { fileType: FILE_TYPE.OTHERS, exactType: null }; return { fileType: FILE_TYPE.OTHERS, exactType: null };
} }
switch (typeParts[0]) { switch (typeParts[0]) {