aboutsummaryrefslogtreecommitdiffstats
path: root/prosodyctl
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2019-09-11 15:03:54 +0100
committerMatthew Wild <mwild1@gmail.com>2019-09-11 15:03:54 +0100
commitf78abda947708f72af2eb948b7ed52f08fd39fe4 (patch)
tree07c8ada11578995f5d458802ddad6ec5db5ce450 /prosodyctl
parent0b46ce246d63f6e3a47323e09db55b25c06aafc8 (diff)
downloadprosody-f78abda947708f72af2eb948b7ed52f08fd39fe4.tar.gz
prosody-f78abda947708f72af2eb948b7ed52f08fd39fe4.zip
prosodyctl: Fix traceback on incorrect proxy65_address type
Diffstat (limited to 'prosodyctl')
-rwxr-xr-xprosodyctl26
1 files changed, 15 insertions, 11 deletions
diff --git a/prosodyctl b/prosodyctl
index e580446b..405ef1f8 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -1103,17 +1103,21 @@ function commands.check(arg)
if modules:contains("proxy65") then
local proxy65_target = configmanager.get(host, "proxy65_address") or host;
- local A, AAAA = dns.lookup(idna.to_ascii(proxy65_target), "A"), dns.lookup(idna.to_ascii(proxy65_target), "AAAA");
- local prob = {};
- if not A then
- table.insert(prob, "A");
- end
- if v6_supported and not AAAA then
- table.insert(prob, "AAAA");
- end
- if #prob > 0 then
- print(" File transfer proxy "..proxy65_target.." has no "..table.concat(prob, "/")
- .." record. Create one or set 'proxy65_address' to the correct host/IP.");
+ if type(proxy65_target) == "string" then
+ local A, AAAA = dns.lookup(idna.to_ascii(proxy65_target), "A"), dns.lookup(idna.to_ascii(proxy65_target), "AAAA");
+ local prob = {};
+ if not A then
+ table.insert(prob, "A");
+ end
+ if v6_supported and not AAAA then
+ table.insert(prob, "AAAA");
+ end
+ if #prob > 0 then
+ print(" File transfer proxy "..proxy65_target.." has no "..table.concat(prob, "/")
+ .." record. Create one or set 'proxy65_address' to the correct host/IP.");
+ end
+ else
+ print(" proxy65_address for "..host.." should be set to a string, unable to perform DNS check");
end
end