From 9554c4675f855e108a40690b0dabe665287ca8f2 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 6 May 2020 16:08:17 -0700 Subject: [PATCH] Fix FileInputButton breaking when path is null (#2129) --- .../insomnia-app/app/ui/components/base/file-input-button.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/insomnia-app/app/ui/components/base/file-input-button.js b/packages/insomnia-app/app/ui/components/base/file-input-button.js index eaa30a59e3..132c5c6fb1 100644 --- a/packages/insomnia-app/app/ui/components/base/file-input-button.js +++ b/packages/insomnia-app/app/ui/components/base/file-input-button.js @@ -78,7 +78,10 @@ class FileInputButton extends React.PureComponent { 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 (