Skip to content

Commit

Permalink
Added check for issue #389
Browse files Browse the repository at this point in the history
  • Loading branch information
giusecapo authored and jkuri committed Jan 31, 2018
1 parent 4e0ca8b commit d5c4d3e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ngx-uploader/directives/ng-file-select.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ export class NgFileSelectDirective implements OnInit, OnDestroy {
}

ngOnDestroy() {
this.el.removeEventListener('change', this.fileListener, false);
this._sub.forEach(sub => sub.unsubscribe());
if (this.el){
this.el.removeEventListener('change', this.fileListener, false);
this._sub.forEach(sub => sub.unsubscribe());
}
}

fileListener = () => {
Expand Down

0 comments on commit d5c4d3e

Please sign in to comment.