diff --git a/modules/ui/src/app/pages/risk-assessment/profile-form/profile-form.component.ts b/modules/ui/src/app/pages/risk-assessment/profile-form/profile-form.component.ts index 763645cc1..2666e7853 100644 --- a/modules/ui/src/app/pages/risk-assessment/profile-form/profile-form.component.ts +++ b/modules/ui/src/app/pages/risk-assessment/profile-form/profile-form.component.ts @@ -114,6 +114,8 @@ export class ProfileFormComponent implements OnInit, AfterViewInit { if (profile && this.nameControl) { this.updateNameValidator(profile); this.fillProfileForm(this.profileFormat, profile); + } else { + this.profileForm.reset(); } } else if (this.profile != profile) { // prevent select profile before user confirmation @@ -371,7 +373,7 @@ export class ProfileFormComponent implements OnInit, AfterViewInit { }); question.answer = answer; } else { - question.answer = this.profileForm.value[index]?.trim(); + question.answer = this.profileForm.value[index]?.trim() || ''; } questions.push(question); });