[Pkg-javascript-commits] [ltx] 93/469: server dnsLookup(): skip on empty result

Jonas Smedegaard dr at jones.dk
Wed Aug 31 13:01:07 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository ltx.

commit fba4a7ac0447a6f114459574637d76d958af9154
Author: Astro <astro at spaceboyz.net>
Date:   Mon Sep 6 06:24:21 2010 +0200

    server dnsLookup(): skip on empty result
---
 lib/xmpp/server.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/xmpp/server.js b/lib/xmpp/server.js
index 34cb2b8..0ef76f7 100644
--- a/lib/xmpp/server.js
+++ b/lib/xmpp/server.js
@@ -105,11 +105,11 @@ exports.makeIncomingServer = function(self) {
 function dnsLookup(domain, cb) {
     // TODO: improve SRV lookups
     dns.resolveSrv('_xmpp-server._tcp.' + domain, function(error, data) {
-	if (data[0])
+	if (data && data[0])
 	    cb(data[0].name, data[0].port);
 	else
 	    dns.resolveSrv('_jabber._tcp.' + domain, function(error, data) {
-		if (data[0])
+		if (data && data[0])
 		    cb(data[0].name, data[0].port);
 		else
 		    cb(domain, 5269);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/ltx.git



More information about the Pkg-javascript-commits mailing list