From 9ec642237ccd140cfa0b456b73a01eea2d1cc983 Mon Sep 17 00:00:00 2001 From: tigerbot Date: Mon, 30 Oct 2017 16:00:35 -0600 Subject: [PATCH] fixed error changing setting in mDNS --- lib/mdns.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/mdns.js b/lib/mdns.js index 9372b22..2c64bfd 100644 --- a/lib/mdns.js +++ b/lib/mdns.js @@ -187,9 +187,10 @@ module.exports.create = function (deps, config) { promise = stop().then(start); } else { // Can't check membership, so just add the current broadcast address to make sure - // it's set. Hopefully nothing bad happens by adding multiple addresses or adding - // the same address multiple times. - socket.addMembership(config.mdns.broadcast); + // it's set. If it's already set it will throw an exception (at least on linux). + try { + socket.addMembership(config.mdns.broadcast); + } catch (e) {} promise = Promise.resolve(); } }