mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
Fix FileInputButton breaking when path is null (#2129)
This commit is contained in:
parent
453745d3e2
commit
9554c4675f
@ -78,7 +78,10 @@ class FileInputButton extends React.PureComponent<Props> {
|
||||
|
||||
render() {
|
||||
const { showFileName, showFileIcon, path, name, ...extraProps } = this.props;
|
||||
const fileName = pathBasename(path);
|
||||
|
||||
// NOTE: Basename fails if path is not a string, so let's make sure it is
|
||||
const fileName = typeof path === 'string' ? pathBasename(path) : null;
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
|
Loading…
Reference in New Issue
Block a user