Skip to content

Commit

Permalink
fix: 修复低版本内核粘贴单张图报错
Browse files Browse the repository at this point in the history
  • Loading branch information
shi-lai-mu committed Aug 8, 2021
1 parent d9aa945 commit 96f2f8d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/menus/img/upload-img.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ class UploadImg {
const resultFiles: File[] = []
const errInfos: string[] = []
arrForEach(files, file => {
// chrome 低版本 粘贴一张图时files为 [null, File]
if (!file) return

const name = file.name || file.type.replace('/', '.') // 兼容低版本chrome 没有name
const size = file.size

Expand Down

0 comments on commit 96f2f8d

Please sign in to comment.