Skip to content

Commit 4d32a71

Browse files
committed
use empty array as default when DNS is not configured in a server
1 parent 2d6f921 commit 4d32a71

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/server/system_services/cluster_server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -781,12 +781,12 @@ function update_dns_servers(req) {
781781
throw new RpcError('OFFLINE_SERVER', 'Server is disconnected');
782782
}
783783
const config_to_compare = [
784-
dns_servers_config.dns_servers ? dns_servers_config.dns_servers.sort() : undefined,
785-
dns_servers_config.search_domains ? dns_servers_config.search_domains.sort() : undefined
784+
dns_servers_config.dns_servers ? dns_servers_config.dns_servers.sort() : [],
785+
dns_servers_config.search_domains ? dns_servers_config.search_domains.sort() : []
786786
];
787787
// don't update servers that already have the dame configuration
788788
target_servers = target_servers.filter(srv => {
789-
const { dns_servers, search_domains } = srv;
789+
const { dns_servers = [], search_domains = [] } = srv;
790790
return !_.isEqual(config_to_compare, [dns_servers.sort(), search_domains.sort()]);
791791
});
792792
if (!target_servers.length) {

0 commit comments

Comments
 (0)