diff --git a/lib/net/upnp.js b/lib/net/upnp.js index 7a8293ca..85ec40de 100644 --- a/lib/net/upnp.js +++ b/lib/net/upnp.js @@ -333,6 +333,7 @@ function UPNPService(options) { UPNPService.prototype.createRequest = function createRequest(action, args) { const type = JSON.stringify(this.serviceType); + let params = ''; for (const [key, value] of args) { @@ -605,14 +606,14 @@ XMLElement.prototype._collect = function _collect(name, result) { */ XMLElement.prototype.find = function find(name) { - for (let child of this.children) { + for (const child of this.children) { if (child.type === name) return child; - child = child.find(name); + const desc = child.find(name); - if (child) - return child; + if (desc) + return desc; } return null;