fiox typeParts undefined check
This commit is contained in:
parent
16e287d1ce
commit
b67a7a9401
|
@ -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]) {
|
||||||
|
|
Loading…
Reference in a new issue