From 233ee31323b64270ac2b609fa82870b1e4138b22 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Thu, 30 Jun 2016 10:54:51 +0200 Subject: [PATCH] prevent console error for undefined value --- .../field-types/wp-display-costs-by-type-field.module.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/app/components/wp-display/field-types/wp-display-costs-by-type-field.module.ts b/frontend/app/components/wp-display/field-types/wp-display-costs-by-type-field.module.ts index 71f5c4878b..4b3655d22a 100644 --- a/frontend/app/components/wp-display/field-types/wp-display-costs-by-type-field.module.ts +++ b/frontend/app/components/wp-display/field-types/wp-display-costs-by-type-field.module.ts @@ -49,7 +49,7 @@ export class CostsByTypeDisplayField extends DisplayField { }).join(', '); }; - public isEmpty():boolean { - return this.value.elements.length === 0; + public isEmpty(): boolean { + return !this.value || this.value.elements.length === 0; } }