Skip to content

Commit

Permalink
Merge pull request #3 from Hypfer/patch-1
Browse files Browse the repository at this point in the history
Fix crash on existing mdns entry
  • Loading branch information
mdidon authored Oct 19, 2021
2 parents 46da651 + 7fc891e commit b179f1f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class Registry {
var service: Service = this
registry.probe(registry.server.mdns, this, (exists: any) => {
if(exists) {
service.stop(service)
service.stop()
console.log(new Error('Service name is already in use on the network'))
return
}
Expand Down Expand Up @@ -185,9 +185,11 @@ export class Registry {
(services as Array<Service>).forEach(function (service) {
service.published = false
})
if (callback) callback.apply(null, arguments)
if (typeof callback === "function") {
callback.apply(null, arguments)
}
})
}
}

export default Registry
export default Registry

0 comments on commit b179f1f

Please sign in to comment.