Skip to content

Commit

Permalink
fix: file description cmd does not always need name / descr.
Browse files Browse the repository at this point in the history
  • Loading branch information
Balte de Wit authored and Alex Van Camp committed Sep 11, 2018
1 parent 8f295d3 commit 683d83b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export class DataTransferFileDescriptionCommand extends AbstractCommand {
serialize () {
const buffer = Buffer.alloc(212)
buffer.writeUInt16BE(this.properties.transferId, 0)
buffer.write(this.properties.name, 2, 20)
buffer.write(this.properties.description, 66, 128)
if (this.properties.name) buffer.write(this.properties.name, 2, 20)
if (this.properties.description) buffer.write(this.properties.description, 66, 128)
buffer.write(this.properties.fileHash, 194, 16)

return Buffer.concat([Buffer.from('FTFD', 'ascii'), buffer])
Expand Down

0 comments on commit 683d83b

Please sign in to comment.