From 195463736cfe21971171aa911dfb45d25dc87354 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Fri, 27 Jul 2018 00:11:22 -0400 Subject: Fix directly uploading zero-byte files Closes #33450. --- activestorage/app/assets/javascripts/activestorage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activestorage/app/assets/javascripts') diff --git a/activestorage/app/assets/javascripts/activestorage.js b/activestorage/app/assets/javascripts/activestorage.js index a22f644238..d3fd795a3a 100644 --- a/activestorage/app/assets/javascripts/activestorage.js +++ b/activestorage/app/assets/javascripts/activestorage.js @@ -484,7 +484,7 @@ }, { key: "readNextChunk", value: function readNextChunk() { - if (this.chunkIndex < this.chunkCount) { + if (this.chunkIndex < this.chunkCount || this.chunkIndex == 0 && this.chunkCount == 0) { var start = this.chunkIndex * this.chunkSize; var end = Math.min(start + this.chunkSize, this.file.size); var bytes = fileSlice.call(this.file, start, end); -- cgit v1.2.3