Skip to content

Commit

Permalink
fix own length when core is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Oct 8, 2024
1 parent e800ee7 commit 79aac97
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,9 @@ module.exports = class Core {

batch.nodes = srcNodes

if (this.header.tree.length < srcBatch.length) {
const ownLength = this.header.tree === null ? 0 : this.header.tree.length

if (ownLength < srcBatch.length) {
batch.upgraded = true
batch.length = srcBatch.length
batch.byteLength = srcBatch.byteLength
Expand Down

0 comments on commit 79aac97

Please sign in to comment.