@smartbit4all/ng-client 3.3.88 → 3.3.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5441,22 +5441,24 @@ class SmartformComponent {
5441
5441
  invalidFieldKeys: [],
5442
5442
  invalidFieldNames: [],
5443
5443
  };
5444
- for (const control of Object.keys(this.form.controls)) {
5445
- if (!this.form.controls[control].valid) {
5446
- let widget = this.service.getSmartFormWidgetByKey(control);
5447
- if (widget &&
5448
- widget.type !== SmartFormWidgetType.CONTAINER &&
5449
- widget.type !== SmartFormWidgetType.INDICATOR &&
5450
- widget.type !== SmartFormWidgetType.LABEL &&
5451
- widget.type !== SmartFormWidgetType.FILE_UPLOADER &&
5452
- widget.type !== SmartFormWidgetType.IMAGE &&
5453
- widget.type !== SmartFormWidgetType.DIVIDER &&
5454
- widget.type !== SmartFormWidgetType.BUTTON &&
5455
- widget.type !== SmartFormWidgetType.COMPONENT &&
5456
- widget.type !== SmartFormWidgetType.YOUTUBE_PLAYER &&
5457
- !widget.isDisabled) {
5458
- invalidFields.invalidFieldNames.push(widget.label);
5459
- invalidFields.invalidFieldKeys.push(widget.key);
5444
+ if (this.form) {
5445
+ for (const control of Object.keys(this.form.controls)) {
5446
+ if (!this.form.controls[control].valid) {
5447
+ let widget = this.service.getSmartFormWidgetByKey(control);
5448
+ if (widget &&
5449
+ widget.type !== SmartFormWidgetType.CONTAINER &&
5450
+ widget.type !== SmartFormWidgetType.INDICATOR &&
5451
+ widget.type !== SmartFormWidgetType.LABEL &&
5452
+ widget.type !== SmartFormWidgetType.FILE_UPLOADER &&
5453
+ widget.type !== SmartFormWidgetType.IMAGE &&
5454
+ widget.type !== SmartFormWidgetType.DIVIDER &&
5455
+ widget.type !== SmartFormWidgetType.BUTTON &&
5456
+ widget.type !== SmartFormWidgetType.COMPONENT &&
5457
+ widget.type !== SmartFormWidgetType.YOUTUBE_PLAYER &&
5458
+ !widget.isDisabled) {
5459
+ invalidFields.invalidFieldNames.push(widget.label);
5460
+ invalidFields.invalidFieldKeys.push(widget.key);
5461
+ }
5460
5462
  }
5461
5463
  }
5462
5464
  }
@@ -5465,7 +5467,7 @@ class SmartformComponent {
5465
5467
  submitForm(validate = true) {
5466
5468
  if (validate) {
5467
5469
  this.smartForm.invalidFields = undefined;
5468
- if (this.form.invalid) {
5470
+ if (this.form && this.form.invalid) {
5469
5471
  for (const control of Object.keys(this.form.controls)) {
5470
5472
  this.form.controls[control].markAsTouched();
5471
5473
  this.form.controls[control].markAsDirty();