nfarina / homebridge-sonos

Sonos plugin for homebridge: https://github.com/nfarina/homebridge
153 stars 52 forks source link

Avoid crashes when search callback args are invaild #68

Closed LaborEtArs closed 4 years ago

LaborEtArs commented 4 years ago

I experienced crashes of the plugin because 'device.deviceDescription(function (err, description)' was called with a 'null' description parameter. The 'err' object contained 'Error: socket hang up' in these cases. Of course the following access to 'var zoneType = description["zoneType"];' lead to a crash then. Maybe the problem is local to me/my network, but...

Inserted a check against an 'undefined' 'description' argument.

nfarina commented 4 years ago

Seems like a good sanity check - thanks!