Tests and increase consistency for isFileDangerous calls

This commit is contained in:
Scott Nonnenberg 2018-10-15 11:54:50 -07:00
parent 8edfbdcee5
commit bc0ec92ad2
2 changed files with 36 additions and 2 deletions

View file

@ -505,7 +505,7 @@ export class Message extends React.Component<Props, State> {
} else {
const { fileName, fileSize, contentType } = attachment;
const extension = getExtension({ contentType, fileName });
const isDangerous = isFileDangerous(fileName);
const isDangerous = isFileDangerous(fileName || '');
return (
<div
@ -738,7 +738,7 @@ export class Message extends React.Component<Props, State> {
return null;
}
const fileName = attachment && attachment.fileName;
const fileName = attachment ? attachment.fileName : null;
const isDangerous = isFileDangerous(fileName || '');
const downloadButton = attachment ? (