Skip to content

Commit 3417e75

Browse files
committed
servers may not have record sets
1 parent a77e150 commit 3417e75

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

lib/dnsbl.js

+18-17
Original file line numberDiff line numberDiff line change
@@ -93,24 +93,25 @@ function dnsblQuery(args, cb) {
9393
var anyScore = false;
9494
var anyCloak = false;
9595

96-
for (var h in hosts) {
97-
var entry = server.records[hosts[h]];
98-
if (entry) {
99-
anyScore = true;
100-
ret[h] = query.score.total;
101-
query.score.total += entry.score || 0;
102-
103-
104-
if (entry.cloak) {
105-
anyCloak = true;
106-
query.score.cloak = entry.cloak;
96+
if (server.records) {
97+
for (var h in hosts) {
98+
var entry = server.records[hosts[h]];
99+
if (entry) {
100+
anyScore = true;
101+
ret[h] = query.score.total;
102+
query.score.total += entry.score || 0;
103+
104+
if (entry.cloak) {
105+
anyCloak = true;
106+
query.score.cloak = entry.cloak;
107+
}
108+
109+
if (entry.isTor)
110+
query.score.isTor = true;
111+
112+
if (entry.reason)
113+
query.score.reasons.push(entry.reason);
107114
}
108-
109-
if (entry.isTor)
110-
query.score.isTor = true;
111-
112-
if (entry.reason)
113-
query.score.reasons.push(entry.reason);
114115
}
115116
}
116117

0 commit comments

Comments
 (0)