Skip to content

Commit

Permalink
use empty array as default when DNS is not configured in a server
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyzaken committed Sep 7, 2017
1 parent 2d6f921 commit 4d32a71
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/system_services/cluster_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -781,12 +781,12 @@ function update_dns_servers(req) {
throw new RpcError('OFFLINE_SERVER', 'Server is disconnected');
}
const config_to_compare = [
dns_servers_config.dns_servers ? dns_servers_config.dns_servers.sort() : undefined,
dns_servers_config.search_domains ? dns_servers_config.search_domains.sort() : undefined
dns_servers_config.dns_servers ? dns_servers_config.dns_servers.sort() : [],
dns_servers_config.search_domains ? dns_servers_config.search_domains.sort() : []
];
// don't update servers that already have the dame configuration
target_servers = target_servers.filter(srv => {
const { dns_servers, search_domains } = srv;
const { dns_servers = [], search_domains = [] } = srv;
return !_.isEqual(config_to_compare, [dns_servers.sort(), search_domains.sort()]);
});
if (!target_servers.length) {
Expand Down

0 comments on commit 4d32a71

Please sign in to comment.