SerafinTech / ST-node-ethernet-ip

Connect to PLC controllers with Node and Ethernet/ip
MIT License
37 stars 20 forks source link

Update index.ts #39

Closed bombjackit closed 1 year ago

bombjackit commented 1 year ago

Reinforced check to cpf[0] that must not be undefined

Description, Motivation, and Context

Because I had this error [error] TypeError: Cannot read property 'data' of undefined at Browser._parseListIdentityResponse (C:\Users\xxxx.node-red\node_modules\st-ethernet-ip\src\browser\index.js:89:41) at Socket. (C:\Users\xxxx.node-red\node_modules\st-ethernet-ip\src\browser\index.js:69:33) at Socket.emit (events.js:400:28) at UDP.onMessage [as onmessage] (dgram.js:931:8)

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist:

Related Issue

SerafinTech commented 1 year ago

I'm going to put this change in the main branch and then delete this fork since it has already been merged.