cflurin / homebridge-mqtt

Homebridge-mqtt is a Plugin for Homebridge.
Apache License 2.0
229 stars 38 forks source link

Payloads with null-values crashes homebride #82

Closed crom1e closed 5 years ago

crom1e commented 5 years ago

I had some hardware errors on a temp-sensor, that ended up generating payloads with null values, like the one below

{"name":"esp_2142759","characteristic":"CurrentTemperature","value":null}

This thew an exception;

crypto.js:99
  this._handle.update(data, encoding);
               ^
TypeError: Data must be a string or a buffer

I will of course prevent this from happening in my end, but it might be handled better server side as well.

cflurin commented 5 years ago

Hi, Sure I can, but what's next? There are a ton of possible errors. The doc tells you what you should send.

crom1e commented 5 years ago

I do think there were other issues in play, I were not been able to reproduce the error after a few restarts of Homebridge.

Now it behaves as it should - ignores the undefined values without crashing homebride..

Sorry. And - thanks for a great module!

Regards me