From 5f5cc5eb220e29bd074b518a6fa9323e1b1732f7 Mon Sep 17 00:00:00 2001 From: lohit Date: Mon, 2 Dec 2024 14:14:10 +0530 Subject: [PATCH] fix: validate env name fn null checks --- .../Environments/EnvironmentSettings/CreateEnvironment/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSettings/CreateEnvironment/index.js b/packages/bruno-app/src/components/Environments/EnvironmentSettings/CreateEnvironment/index.js index 95dc550c88..ee1b5dea8d 100644 --- a/packages/bruno-app/src/components/Environments/EnvironmentSettings/CreateEnvironment/index.js +++ b/packages/bruno-app/src/components/Environments/EnvironmentSettings/CreateEnvironment/index.js @@ -13,7 +13,7 @@ const CreateEnvironment = ({ collection, onClose }) => { // todo: Add this to global env too. const validateEnvironmentName = (name) => { - return !collection.environments.some((env) => env?.name?.toLowerCase().trim() === name?.toLowerCase().trim()); + return !collection?.environments?.some((env) => env?.name?.toLowerCase().trim() === name?.toLowerCase().trim()); }; const formik = useFormik({