Skip to content

Commit

Permalink
🐛 Fix suspend for unclosed NBT array tags
Browse files Browse the repository at this point in the history
Fix #415.
  • Loading branch information
SPGoding committed Apr 25, 2020
1 parent d38573f commit 77f13d5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/parsers/NbtArgumentParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,6 @@ export default class NbtArgumentParser extends ArgumentParser<NbtNode> {
const result = this.parsePrimitiveTag(reader, superNode, helper)
combineArgumentParserResult(ans, result)
reader.skipWhiteSpace()
if (reader.peek() === ',') {
reader
.skip()
.skipWhiteSpace()
}
if (ans.data[NbtNodeType] === 'ByteArray') {
ans.data.push(result.data as NbtByteNode)
if (!isNbtByteNode(result.data)) {
Expand Down Expand Up @@ -455,6 +450,13 @@ export default class NbtArgumentParser extends ArgumentParser<NbtNode> {
)
}
}
if (reader.peek() === ',') {
reader
.skip()
.skipWhiteSpace()
continue
}
break
}
reader
.expect(']')
Expand Down

0 comments on commit 77f13d5

Please sign in to comment.