Browse Source

Guard against missing data in ExtensibleFormProp

Return early in ExtensibleFormPropComponent effect when this.data()?.data is falsy. Previously the effect only checked currentProp and could attempt to access properties on undefined data, causing runtime errors; this adds a defensive check to avoid that.
pull/24777/head
Fahri Gedik 7 months ago
parent
commit
371bc43671
  1. 2
      npm/ng-packs/packages/components/extensible/src/lib/components/extensible-form/extensible-form-prop.component.ts

2
npm/ng-packs/packages/components/extensible/src/lib/components/extensible-form/extensible-form-prop.component.ts

@ -120,7 +120,7 @@ export class ExtensibleFormPropComponent implements AfterViewInit {
effect(() => {
const currentProp = this.prop();
const data = this.data()?.data;
if (!currentProp) return;
if (!currentProp || !data) return;
const { options, readonly, disabled, validators, className, template } = currentProp;

Loading…
Cancel
Save