Skip to content

Commit

Permalink
fix(theme): check ref before detaching (#1116)
Browse files Browse the repository at this point in the history
  • Loading branch information
tibing-old-email authored and nnixaa committed Dec 29, 2018
1 parent aae49a1 commit af58d3f
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ export abstract class NbBasePicker<D, T, P> extends NbDatepicker<T> implements O
ngOnDestroy() {
this.alive = false;
this.hide();
this.ref.dispose();

if (this.ref) {
this.ref.dispose();
}
}

/**
Expand Down Expand Up @@ -238,7 +241,10 @@ export abstract class NbBasePicker<D, T, P> extends NbDatepicker<T> implements O
}

hide() {
this.ref.detach();
if (this.ref) {
this.ref.detach();
}

// save current value if picker was rendered
if (this.picker) {
this.queue = this.value;
Expand Down

0 comments on commit af58d3f

Please sign in to comment.