homebridge / bonjour

A Bonjour/Zeroconf protocol implementation in JavaScript
MIT License
12 stars 7 forks source link

Fix unhandled exception #1

Closed ebaauw closed 5 years ago

ebaauw commented 5 years ago

txt.decode() throws an error when its argument is not a Buffer. rr.data is an Array of Buffer instead of a Buffer. Not sure what exactly caused the change, but it seems to be introduced in 3.5.2 with the bump of multicast-dns.

TypeError: buffer is not a buffer
at bufferIndexOf (/Users/ebaauw/GitHub/homebridge-lib/node_modules/buffer-indexof/index.js:3:11)
at Object.that.decode (/Users/ebaauw/GitHub/homebridge-lib/node_modules/dns-txt/index.js:55:15)
at /Users/ebaauw/GitHub/homebridge-lib/node_modules/bonjour-hap/lib/Browser.js:179:31
at Array.forEach (<anonymous>)
at /Users/ebaauw/GitHub/homebridge-lib/node_modules/bonjour-hap/lib/Browser.js:164:10
at Array.map (<anonymous>)
at buildServicesFor (/Users/ebaauw/GitHub/homebridge-lib/node_modules/bonjour-hap/lib/Browser.js:155:6)
at /Users/ebaauw/GitHub/homebridge-lib/node_modules/bonjour-hap/lib/Browser.js:81:21
at Array.forEach (<anonymous>)
at EventEmitter._onresponse (/Users/ebaauw/GitHub/homebridge-lib/node_modules/bonjour-hap/lib/Browser.js:76:26)
KhaosT commented 5 years ago

Thx :)