From b872fdfe6de74f0ec41a73399bc6f1f216c181a6 Mon Sep 17 00:00:00 2001 From: Pragadesh-45 <54320162+Pragadesh-45@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:49:00 +0530 Subject: [PATCH] Bugfix- Import blank directory Exception (#2845) * typofix: Loc is required * handle empty dirpath on import collection * fix: collection import bug fix --------- Co-authored-by: Anoop M D --- .../components/Sidebar/ImportCollectionLocation/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/bruno-app/src/components/Sidebar/ImportCollectionLocation/index.js b/packages/bruno-app/src/components/Sidebar/ImportCollectionLocation/index.js index ff8db4eaa..7dd827298 100644 --- a/packages/bruno-app/src/components/Sidebar/ImportCollectionLocation/index.js +++ b/packages/bruno-app/src/components/Sidebar/ImportCollectionLocation/index.js @@ -115,7 +115,7 @@ const ImportCollectionLocation = ({ onClose, handleSubmit, collectionName, trans collectionLocation: Yup.string() .min(1, 'must be at least 1 character') .max(500, 'must be 500 characters or less') - .required('name is required') + .required('Location is required') }), onSubmit: (values) => { handleSubmit(values.collectionLocation); @@ -124,7 +124,9 @@ const ImportCollectionLocation = ({ onClose, handleSubmit, collectionName, trans const browse = () => { dispatch(browseDirectory()) .then((dirPath) => { - formik.setFieldValue('collectionLocation', dirPath); + if (typeof dirPath === 'string' && dirPath.length > 0) { + formik.setFieldValue('collectionLocation', dirPath); + } }) .catch((error) => { formik.setFieldValue('collectionLocation', '');