diff --git a/ui/component/publishFile/view.jsx b/ui/component/publishFile/view.jsx index fbb35cbcf..41fc88ef0 100644 --- a/ui/component/publishFile/view.jsx +++ b/ui/component/publishFile/view.jsx @@ -310,7 +310,7 @@ function PublishFile(props: Props) { filePath: file.path || file, }; // Strip off extention and replace invalid characters - let fileName = name || file.name.substr(0, file.name.lastIndexOf('.')) || file.name; + let fileName = name || (file.name && file.name.substr(0, file.name.lastIndexOf('.'))) || ''; if (!isStillEditing) { publishFormParams.name = parseName(fileName);