From f1ae8c419e4208a0dfa6f80405c637e2ea26eaba Mon Sep 17 00:00:00 2001 From: Mateusz Dobrowolski Date: Fri, 15 Apr 2022 13:08:56 +0200 Subject: [PATCH] fix(validation-messages): fix invalid own property check --- .../validation-messages/validation-messages.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/validation-messages/src/lib/components/validation-messages/validation-messages.component.ts b/packages/validation-messages/src/lib/components/validation-messages/validation-messages.component.ts index c67d37d..977abad 100644 --- a/packages/validation-messages/src/lib/components/validation-messages/validation-messages.component.ts +++ b/packages/validation-messages/src/lib/components/validation-messages/validation-messages.component.ts @@ -155,7 +155,10 @@ export class ValidationMessagesComponent implements OnDestroy, DoCheck { if (this.control && this.control.errors) { for (const propertyName in this.control.errors) { if ( - Object.prototype.hasOwnProperty.call(this.control, propertyName) && + Object.prototype.hasOwnProperty.call( + this.control.errors, + propertyName + ) && propertyName !== "server" && !(!this.multiple && this.errorMessages.length === 1) ) {