mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-25 00:25:03 +08:00
Fallback to empty string for files with null
names (synced before 1.1.1) #626
This commit is contained in:
parent
1fbc274ba5
commit
7ab5347be9
1 changed files with 1 additions and 1 deletions
|
@ -165,7 +165,7 @@ module.exports = Utils = {
|
|||
// Given a File object or uploadData of an uploading file object,
|
||||
// determine if it looks like an image and is in the size range for previews
|
||||
shouldDisplayAsImage(file = {}) {
|
||||
const name = file.filename || file.fileName || file.name;
|
||||
const name = file.filename || file.fileName || file.name || '';
|
||||
const size = file.size || file.fileSize || 0;
|
||||
const ext = path.extname(name).toLowerCase();
|
||||
const extensions = ['.jpg', '.bmp', '.gif', '.png', '.jpeg'];
|
||||
|
|
Loading…
Reference in a new issue