Skip to content

Commit 5809f5e

Browse files
Merge pull request #447 from ryanseys/check-config-obj
Check config object exists before getting firstChunk
2 parents f1a3844 + a5df4ec commit 5809f5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/storage/file.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ File.prototype.startResumableUpload_ = function(stream, metadata) {
10241024
// by caching a slice of the first chunk, then comparing it with the first
10251025
// byte of incoming data.
10261026
if (bytesWritten === 0) {
1027-
var cachedFirstChunk = configStore.get(that.name).firstChunk;
1027+
var cachedFirstChunk = config && config.firstChunk;
10281028
var firstChunk = chunk.slice(0, 16);
10291029

10301030
if (!cachedFirstChunk) {

0 commit comments

Comments
 (0)