Merge pull request #5 from fisch0920/master

small bugfix for issue where peer may not have any extensions as advertised
This commit is contained in:
Feross Aboukhadijeh 2014-05-17 13:32:00 -07:00
commit 77b25ddeeb
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ module.exports = function (metadata) {
}
ut_metadata.prototype.onExtendedHandshake = function (handshake) {
if (!handshake.m.ut_metadata) {
if (!handshake.m || !handshake.m.ut_metadata) {
return this.emit('warning', new Error('Peer does not support ut_metadata'))
}
if (!handshake.metadata_size) {