Skip to content

Commit

Permalink
Merge pull request #8 from github/default-transfer-files-to-an-empty-…
Browse files Browse the repository at this point in the history
…error

Default `transfer.files` to an empty array
  • Loading branch information
koddsson authored May 7, 2020
2 parents 1052711 + e2fada2 commit ee3600f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/attachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function transferredFiles(transfer: DataTransfer, directory: boolean): Promise<A
if (directory && isDirectory(transfer)) {
return traverse('', roots(transfer))
}
return Promise.resolve(visible(Array.from(transfer.files)).map(f => new Attachment(f)))
return Promise.resolve(visible(Array.from(transfer.files || [])).map(f => new Attachment(f)))
}

function hidden(file: File | FileSystemEntry): boolean {
Expand Down

0 comments on commit ee3600f

Please sign in to comment.