aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/app/assets/javascripts
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-07-27 00:11:22 -0400
committerGeorge Claghorn <george@basecamp.com>2018-07-27 00:11:22 -0400
commit195463736cfe21971171aa911dfb45d25dc87354 (patch)
tree20c2b30bc17cabb1965c1b4a38c7778a225ee2c0 /activestorage/app/assets/javascripts
parent36f28fd8184a999f82bd8b0388e31798bd856ae0 (diff)
downloadrails-195463736cfe21971171aa911dfb45d25dc87354.tar.gz
rails-195463736cfe21971171aa911dfb45d25dc87354.tar.bz2
rails-195463736cfe21971171aa911dfb45d25dc87354.zip
Fix directly uploading zero-byte files
Closes #33450.
Diffstat (limited to 'activestorage/app/assets/javascripts')
-rw-r--r--activestorage/app/assets/javascripts/activestorage.js2
1 files changed, 1 insertions, 1 deletions
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);