From fd35529f38d0a72e62d46a4ebf595279a6f19e4a Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 11 Dec 2017 12:04:18 -0500 Subject: [PATCH] fix bug for iterating validationErrors --- src/popup/app/services/validation.service.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/popup/app/services/validation.service.ts b/src/popup/app/services/validation.service.ts index 747c151c56..f68f540cb7 100644 --- a/src/popup/app/services/validation.service.ts +++ b/src/popup/app/services/validation.service.ts @@ -13,11 +13,15 @@ export class ValidationService { } else if (!data.validationErrors) { errors.push(data.message ? data.message : defaultErrorMessage); } else { - data.validationErrors.forEach((error: any) => { - error.forEach((item: string) => { + for (const key in data.validationErrors) { + if (!data.validationErrors.hasOwnProperty(key)) { + continue; + } + + data.validationErrors[key].forEach((item: string) => { errors.push(item); }); - }); + } } if (errors.length) {