Make the file extension algorithm return if a file wasn't provided
This commit is contained in:
parent
b983b74816
commit
62cbd9b9d8
1 changed files with 1 additions and 0 deletions
|
|
@ -147,6 +147,7 @@ export async function uploadFile(path, file) {
|
|||
};
|
||||
|
||||
export function determineFileExtension(file) {
|
||||
if (!file) return null;
|
||||
for (const [short, long] of Object.entries(CONST.IMAGE_FILE_EXTENSIONS)) {
|
||||
if (long === file.type) {
|
||||
return short;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue