fix file page crashing when navigating from repost link on trasaction list

This commit is contained in:
Sean Yesmunt 2020-02-13 16:32:06 -05:00
parent ba9e26a8cc
commit 28ce9a4c90

View file

@ -27,7 +27,8 @@ class FileDetails extends PureComponent<Props> {
const { description, languages, license } = metadata; const { description, languages, license } = metadata;
const mediaType = contentType || 'unknown'; const mediaType = contentType || 'unknown';
const fileSize = metadata.source.size const fileSize =
metadata.source && metadata.source.size
? formatBytes(metadata.source.size) ? formatBytes(metadata.source.size)
: fileInfo && fileInfo.download_path && formatBytes(fileInfo.written_bytes); : fileInfo && fileInfo.download_path && formatBytes(fileInfo.written_bytes);
let downloadPath = fileInfo && fileInfo.download_path ? path.normalize(fileInfo.download_path) : null; let downloadPath = fileInfo && fileInfo.download_path ? path.normalize(fileInfo.download_path) : null;