mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 15:13:21 +00:00
Ensure provider is always assigned on uploaded file
Previously the uploaded file data was assigned a provider in the conditional block that calculated dimensions on supported images. This caused the provider to be stored as null in the database for some image uploads such as SVG. The provider property is now assigned unconditionally
This commit is contained in:
parent
6df5d8d11f
commit
8747947cf3
@ -189,11 +189,11 @@ module.exports = ({ strapi }) => ({
|
||||
const { width, height } = await getDimensions(fileData);
|
||||
|
||||
_.assign(fileData, {
|
||||
provider: config.provider,
|
||||
width,
|
||||
height,
|
||||
});
|
||||
}
|
||||
_.set(fileData, 'provider', config.provider);
|
||||
|
||||
return this.add(fileData, { user });
|
||||
},
|
||||
@ -285,11 +285,11 @@ module.exports = ({ strapi }) => ({
|
||||
const { width, height } = await getDimensions(fileData);
|
||||
|
||||
_.assign(fileData, {
|
||||
provider: config.provider,
|
||||
width,
|
||||
height,
|
||||
});
|
||||
}
|
||||
_.set(fileData, 'provider', config.provider);
|
||||
} finally {
|
||||
// delete temporary folder
|
||||
await fse.remove(tmpWorkingDirectory);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user