bbindreiter / node-red-contrib-alexa-remote2-applestrudel

Node-Red Nodes for interacting with Alexa
https://flows.nodered.org/node/node-red-contrib-alexa-remote2-applestrudel
MIT License
74 stars 20 forks source link

TypeError: Cannot read properties of undefined (Reading 'map') #160

Closed jonferreira closed 6 months ago

jonferreira commented 7 months ago

Greetings.

Today, out of the blue, my node-red instance got stuck in a crash loop. Upon investigating I've found out it was this node that was crashing node-red.

image

I've "fixed it" by changing:

this.deviceByIdExt = new Map(response.devices.map(o => [o.serialNumber, o]));

into

this.deviceByIdExt = new Map(response.devices?.map(o => [o.serialNumber, o]));

but someone smarter than me should take a look at it :D

bbindreiter commented 7 months ago

Hello, thanks for reporting. Could you make a PR with this null check please?

jonferreira commented 7 months ago

161

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 6 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.