Skip to content

Commit

Permalink
Cannot read property 'log' of undefined (#5622)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuryagdym authored Feb 16, 2021
1 parent 1643d56 commit 7994029
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ function buildChecksumMap(file: BlockMapFile, fileOffset: number, logger: Logger
const checksumToOffset = new Map<string, number>()
const checksumToSize = new Map<string, number>()
let offset = fileOffset
const debugLog = logger.debug
for (let i = 0; i < file.checksums.length; i++) {
const checksum = file.checksums[i]
const size = file.sizes[i]
Expand All @@ -120,9 +119,9 @@ function buildChecksumMap(file: BlockMapFile, fileOffset: number, logger: Logger
checksumToOffset.set(checksum, offset)
checksumToSize.set(checksum, size)
}
else if (debugLog != null) {
else if (logger.debug != null) {
const sizeExplanation = existing === size ? "(same size)" : `(size: ${existing}, this size: ${size})`
debugLog(`${checksum} duplicated in blockmap ${sizeExplanation}, it doesn't lead to broken differential downloader, just corresponding block will be skipped)`)
logger.debug(`${checksum} duplicated in blockmap ${sizeExplanation}, it doesn't lead to broken differential downloader, just corresponding block will be skipped)`)
}
offset += size
}
Expand Down

0 comments on commit 7994029

Please sign in to comment.