Merge pull request #3578 from lohxt1/fix/validate-env-name-validations

fix: validate env name fn null checks
This commit is contained in:
lohit 2024-12-02 14:14:53 +05:30 committed by GitHub
commit fd22ff8962
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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({