Return empty a empty stream for zero sized blob (#86)

Return empty a empty stream for zero sized blob
This commit is contained in:
Jimmy Wärting
2021-04-29 14:01:01 +02:00
committed by GitHub
parent 483973cf25
commit a8fed4e338
3 changed files with 16 additions and 0 deletions
+4
View File
@@ -43,6 +43,10 @@ class BlobDataItem {
throw new DOMException('The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.', 'NotReadableError');
}
if (!this.size) {
return new Blob().stream();
}
return createReadStream(this.path, {
start: this.start,
end: this.start + this.size - 1