Skip to content

Commit 145075f

Browse files
authored
fix: handle progress for empty files (#3260)
When a file is empty the progress event will have a `Bytes` property that is `0` so test if the property is not undefined rather than if it is truthy. Fixes #3255
1 parent b075732 commit 145075f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/add-all.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ module.exports = configure((api) => {
3232
for await (let file of res.ndjson()) {
3333
file = toCamel(file)
3434

35-
if (progressFn && file.bytes) {
36-
progressFn(file.bytes)
37-
} else {
35+
if (file.hash !== undefined) {
3836
yield toCoreInterface(file)
37+
} else if (progressFn) {
38+
progressFn(file.bytes || 0)
3939
}
4040
}
4141
}

0 commit comments

Comments
 (0)