fix app crash when file name can't be found
This commit is contained in:
parent
c4e6605ada
commit
1854710093
1 changed files with 1 additions and 1 deletions
|
@ -310,7 +310,7 @@ function PublishFile(props: Props) {
|
||||||
filePath: file.path || file,
|
filePath: file.path || file,
|
||||||
};
|
};
|
||||||
// Strip off extention and replace invalid characters
|
// 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) {
|
if (!isStillEditing) {
|
||||||
publishFormParams.name = parseName(fileName);
|
publishFormParams.name = parseName(fileName);
|
||||||
|
|
Loading…
Add table
Reference in a new issue