mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-20 06:56:18 -05:00
Adding error when previewFile is not an object.
This commit is contained in:
parent
87b179eeb9
commit
b6eb888761
1 changed files with 5 additions and 0 deletions
|
|
@ -92,6 +92,11 @@ export function FilePreviewWrapper({children}) {
|
|||
|
||||
React.useEffect(() => {
|
||||
setPreviewModal(null);
|
||||
if (previewFile && !_.isObject(previewFile)) {
|
||||
console.error(`Unknown previewFile type: ${typeof previewFile}`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (previewFile && !_.isEmpty(previewFile)) {
|
||||
const {mimetype, size} = previewFile;
|
||||
console.debug(`useFilePreview path=${previewFile['path']} mimetype=${mimetype}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue