From 57e87a09d2e457ab30df304eaa96988c6ea1c78b Mon Sep 17 00:00:00 2001 From: marcinrzepeckiwroc Date: Fri, 11 Dec 2020 14:52:17 +0100 Subject: Fix for VID-928: NullPointerException during deploy service instance with empty cds model fields. Flag "Skip post instantiation configuration" is not collected. Issue-ID: VID-928 Signed-off-by: marcinrzepeckiwroc Change-Id: I3cabaf1b503160a6352fd89f511b3e6d7b706064 --- .../formControlsServices/control.generator.util.service.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'vid-webpack-master/src/app/shared/components') diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/control.generator.util.service.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/control.generator.util.service.ts index bcbcefa8d..fce6c6ec8 100644 --- a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/control.generator.util.service.ts +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/control.generator.util.service.ts @@ -147,7 +147,7 @@ export class ControlGeneratorUtil { case 'select' : case 'boolean' : { data.value = data.value || input.optionList.filter((option) => option.isDefault ? option.id || option.name : null); - data.onInit = this.getSubscribeInitResult.bind(null, this.getInputsOptions.bind(this, input.optionList)); + data.onInit = this.getSubscribeInitResult.bind(null, input.optionList == null ? this.getBooleanOptions : this.getInputsOptions.bind(this, input.optionList)); result.push(new DropdownFormControl(data)); break; } @@ -250,4 +250,11 @@ export class ControlGeneratorUtil { ]); }; + getBooleanOptions = (): Observable => { + return of([ + new SelectOption({id: 'true', name: 'true'}), + new SelectOption({id: 'false', name: 'false'}) + ]); + }; + } -- cgit 1.2.3-korg