Skip to content

Commit

Permalink
fix: Make sure the dynamic component outlet doesn,t raise an error wh…
Browse files Browse the repository at this point in the history
…en the component is undefined (#1007)
  • Loading branch information
cbourget authored Mar 17, 2022
1 parent 7cb159f commit 2170f16
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ export class DynamicOutletComponent implements OnChanges, OnDestroy {
const subscribers = changes.subscribers;
const eq = ObjectUtils.objectsAreEquivalent;

if (component && component.currentValue !== component.previousValue) {
if (!component || !component.currentValue) {
return;
}

if (component.currentValue !== component.previousValue) {
this.createComponent(component.currentValue);
} else {
const inputsAreEquivalents =
Expand Down

0 comments on commit 2170f16

Please sign in to comment.