mirror of
https://github.com/Kong/insomnia.git
synced 2026-10-25 16:19:20 -04:00
Fix FileInputButton breaking when path is null (#2129)
This commit is contained in:
1 parent
453745d3e2
commit
9554c4675f
1 file changed
+4
-1
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user