From f6456b4dcb959fd59f4ff7694e7849e96a50db32 Mon Sep 17 00:00:00 2001
From: Cindy <cindy.nacibide@teamdlab.com>
Date: Thu, 10 Dec 2020 13:11:41 +0100
Subject: [PATCH] [FIX TRTL-574] don't apply theme when colors are not valid

---
 .../graphic-identity-form.component.ts                     | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts
index 113435f68..57055db2f 100644
--- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts
+++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts
@@ -41,8 +41,11 @@ export class GraphicIdentityFormComponent implements OnInit {
   }
 
   private applyTheme(): void {
-    const colors = this.themeService.getThemeColors(this.graphicIdentityForm.get('themeColors').value);
-    this.themeService.overloadLocalTheme(colors, '#toOverride');
+    if(this.graphicIdentityForm.valid)
+    {
+      const colors = this.themeService.getThemeColors(this.graphicIdentityForm.get('themeColors').value);
+      this.themeService.overloadLocalTheme(colors, '#toOverride');
+    }
   }
 
   public addOrReplaceLogo(type: AttachmentType, data: File): void {
-- 
GitLab