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,9 +27,10 @@ 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 =
? formatBytes(metadata.source.size) metadata.source && metadata.source.size
: fileInfo && fileInfo.download_path && formatBytes(fileInfo.written_bytes); ? formatBytes(metadata.source.size)
: 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;
let downloadNote; let downloadNote;
// If the path is blank, file is not available. Streamed files won't have any blobs saved // If the path is blank, file is not available. Streamed files won't have any blobs saved