Skip to content

Error bebop.js : Cannot read property 'readUInt8' of undefined #65

@kolki

Description

@kolki

i have encountered this error

TypeError: Cannot read property 'readUInt8' of undefined
at Bebop._packetReceiver (/home/kit/node_modules/node-bebop/lib/bebop.js:301:43)
at emitTwo (events.js:87:13)
at Socket.emit (events.js:172:7)
at UDP.onMessage (dgram.js:480:8)

as i test any command.

in fact i modify bebop.js like this

line 307 FROM

 if ( networkFrame.id === constants.BD_NET_DC_EVENT_ID || networkFrame.id === constants.BD_NET_DC_NAVDATA_ID){

TO

 if ( (networkFrame.id === constants.BD_NET_DC_EVENT_ID ||
  networkFrame.id === constants.BD_NET_DC_NAVDATA_ID) && networkFrame.data !==  undefined) 

it seems sometime data field have lengfh but is empty.

{ type: 4,
  id: 126,
  seq: 53,
  size: 15,
  data: <Buffer 01 04 0f 00 03 00 00 00> }
{ type: 4, id: 126, seq: 54, size: 7 }
/home/kit/node_modules/node-bebop/lib/bebop.js:307
    var commandProject = networkFrame.data.readUInt8(0),
                                          ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions