From b7d9586a8c998966ee23c02dad1ff7a4d53bab23 Mon Sep 17 00:00:00 2001 From: Jan Kuri Date: Sun, 20 Nov 2016 21:25:31 +0100 Subject: [PATCH] asd --- package.json | 2 +- src/directives/ng-file-drop.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 2ff5bff2..14a121bd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ng2-uploader", "description": "Angular2 File Uploader", - "version": "1.5.1", + "version": "1.5.2", "license": "MIT", "main": "ng2-uploader.js", "typings": "ng2-uploader.d.ts", diff --git a/src/directives/ng-file-drop.ts b/src/directives/ng-file-drop.ts index 9ce5f988..3f66e14a 100644 --- a/src/directives/ng-file-drop.ts +++ b/src/directives/ng-file-drop.ts @@ -108,6 +108,10 @@ export class NgFileDropDirective { } @HostListener('change') onChange(): void { + if (!this.el.nativeElement.files || !this.el.nativeElement.files.length) { + return; + } + this.files = Array.from(this.el.nativeElement.files); if (this.options.filterExtensions && this.options.allowedExtensions) {