From 3822fc1c51bfdd46475dbaa1148f6914642ddcbf Mon Sep 17 00:00:00 2001 From: tobuck-aws Date: Wed, 6 Apr 2022 14:49:13 -0700 Subject: [PATCH] Fix bug with adding services --- client/web/src/settings/ApplicationComponent.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/client/web/src/settings/ApplicationComponent.js b/client/web/src/settings/ApplicationComponent.js index b270b621..7103a60d 100644 --- a/client/web/src/settings/ApplicationComponent.js +++ b/client/web/src/settings/ApplicationComponent.js @@ -398,12 +398,16 @@ export function ApplicationComponent(props) { const findServicesWithErrors = (formik) => { let servicesWithErrors = [] - if (!!formik.errors.services) { - formik.errors.services.forEach((service, index) => { - if (!!service) { - servicesWithErrors.push(formik.values.services[index].name) - } - }) + if (!!formik?.errors?.services) { + if (typeof formik.errors.services === 'string') { + servicesWithErrors.push(formik.errors.services) + } else { + formik.errors.services?.forEach((service, index) => { + if (!!service) { + servicesWithErrors.push(formik.values?.services[index].name) + } + }) + } } return servicesWithErrors.join(', ') }