Skip to content

Commit 5fbb337

Browse files
committed
bug fix #392
Cannot read property 'unsubscribe' of undefined #392
1 parent 2740903 commit 5fbb337

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

projects/angular2-multiselect-dropdown-lib/src/lib/multiselect.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,10 @@ export class AngularMultiSelect implements OnInit, ControlValueAccessor, OnChang
721721
this.onScrollToEnd.emit(e);
722722
}
723723
ngOnDestroy() {
724-
this.subscription.unsubscribe();
724+
if(this.subscription){
725+
this.subscription.unsubscribe();
726+
}
727+
725728
}
726729
selectGroup(item: any) {
727730
if (item.selected) {

0 commit comments

Comments
 (0)