Skip to content

Commit

Permalink
fix(directive): Safely access component outlet instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Malkevich committed Apr 4, 2017
1 parent beec530 commit 6c086d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dynamic/dynamic.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class DynamicDirective implements OnChanges, DoCheck, OnDestroy {
private _destroyed$ = new Subject<void>();

private get _compOutletInst(): any {
return this._componentOutlet && (<any>this._componentOutlet)._componentRef.instance;
return this._componentOutlet && (<any>this._componentOutlet)._componentRef && (<any>this._componentOutlet)._componentRef.instance;
}

private get _componentInst(): any {
Expand Down

0 comments on commit 6c086d8

Please sign in to comment.