Fix crash in statusOk computation
This commit is contained in:
+6
-8
@@ -101,15 +101,13 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
|
||||
|
||||
domain.status = result;
|
||||
|
||||
// those states always exist
|
||||
domain.statusOk = result.relay.status && result.dns.mx.status;
|
||||
domain.statusOk = Object.keys(result).every(function (k) {
|
||||
if (k === 'dns') return Object.keys(result.dns).every(function (k) { return result.dns[k].status; });
|
||||
|
||||
// those states only exist if no relay is used
|
||||
if (typeof result.dns.spf !== 'undefined') domain.statusOk = domain.statusOk && result.dns.spf.status;
|
||||
if (typeof result.dns.dkim !== 'undefined') domain.statusOk = domain.statusOk && result.dns.dkim.status;
|
||||
if (typeof result.dns.dmarc !== 'undefined') domain.statusOk = domain.statusOk && result.dns.dmarc.status;
|
||||
if (typeof result.dns.ptr !== 'undefined') domain.statusOk = domain.statusOk && result.dns.ptr.status;
|
||||
if (typeof result.rbl.status === 'boolean') domain.statusOk = domain.statusOk && result.rbl.status;
|
||||
if (!('status' in result[k])) return true; // if status is not present, the test was not run
|
||||
|
||||
return result[k].status;
|
||||
});
|
||||
});
|
||||
|
||||
Client.getMailConfigForDomain(domain.domain, function (error, mailConfig) {
|
||||
|
||||
Reference in New Issue
Block a user