diff --git a/src/ngx-uploader/directives/ng-file-drop.directive.ts b/src/ngx-uploader/directives/ng-file-drop.directive.ts index 232a4090..7085f429 100644 --- a/src/ngx-uploader/directives/ng-file-drop.directive.ts +++ b/src/ngx-uploader/directives/ng-file-drop.directive.ts @@ -35,7 +35,9 @@ export class NgFileDropDirective implements OnInit, OnDestroy { } ngOnDestroy() { - this.uploadInput.unsubscribe(); + if(this.uploadInput) { + this.uploadInput.unsubscribe(); + } } stopEvent = (e: Event) => {