naimo84 / node-red-contrib-pi-hole-remote

Node RED module for controlling a remote pi-hole
MIT License
10 stars 2 forks source link

Error message, but not sure why #23

Closed My-Random-Thoughts closed 3 years ago

My-Random-Thoughts commented 3 years ago

I am getting the following error message from your node, and I don't know why: TypeError: Cannot read property 'hasOwnProperty' of undefined

I am triggering it from an inject node with a msg.trigger = 10 property set. No other node minds this.

image

EDIT: I use several trigger nodes in minute intervals of 5, 10, 15, etc to set various flows going at specific times. Everything else works fine.

My-Random-Thoughts commented 3 years ago

This line https://github.com/naimo84/node-red-contrib-pi-hole-remote/blob/c400c5e0552fd518cad1b5a962b4e75bd9c61268/src/pi-hole-control.ts#L26 assumes that msg.payload exists, you'll need a check before that.

naimo84 commented 3 years ago

Hi @My-Random-Thoughts,

i've pushed v0.2.0. It's on the way ;)

I'll close this for now. Feel free to reopen it.

Greets, Benjamin

P.S. If you like this node, would you mind to give it a star? Thanks 👍