Skip to content

Commit

Permalink
handle missing endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
erossignon committed Jun 19, 2018
1 parent 3eabb73 commit ed4ae99
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/node-opcua-server/src/register_server_manager.js
Expand Up @@ -488,6 +488,11 @@ RegisterServerManager.prototype._registerServer = function(isOnline, outer_callb
const server = this.server;
const selectedEndpoint = self.selectedEndpoint;

if (!selectedEndpoint) {
console.log("Warning : cannot register server - no endpoint avaialble");
return outer_callback(new Error("Cannot registerServer"));
}

const options = {
securityMode: selectedEndpoint.securityMode,
securityPolicy: SecurityPolicy.get(selectedEndpoint.securityPolicyUri),
Expand Down

0 comments on commit ed4ae99

Please sign in to comment.