From 5bd8579e7350107ba08949fad34e10e8f2a13755 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 30 Oct 2015 16:24:56 -0700 Subject: [PATCH] add null check --- src/mailer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mailer.js b/src/mailer.js index c81e03c60..c2b805c1c 100644 --- a/src/mailer.js +++ b/src/mailer.js @@ -103,8 +103,8 @@ function getTxtRecords(callback) { function checkDns() { getTxtRecords(function (error, records) { - if (error) { - debug('checkDns: DNS error looking up TXT records for %s', config.fqdn(), error); + if (error || !records) { + debug('checkDns: DNS error or no records looking up TXT records for %s %s', config.fqdn(), error, records); gCheckDnsTimerId = setTimeout(checkDns, 60000); return; }