Skip to content

Commit 3b2c58a

Browse files
committed
feat(tpl): verify if entry is a directory
Verify if entry is a directory rather than assuming it is in `else` case.
1 parent d1dca59 commit 3b2c58a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tpl/frontend/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@
531531
increaseCb();
532532
typeof console !== strUndef && console.error(err);
533533
});
534-
} else {
534+
} else if (entry.isDirectory) {
535535
var reader = entry.createReader();
536536
reader.readEntries(function (subEntries) {
537537
if (subEntries.length) {
@@ -566,7 +566,7 @@
566566
// so workaround is for all browsers, just get first hierarchy of files by item.getAsFile()
567567
var file = item.getAsFile();
568568
files.push({file: file, relativePath: file.name});
569-
} else {
569+
} else if (entry.isDirectory) {
570570
entries.push(entry);
571571
}
572572
}

0 commit comments

Comments
 (0)