# HG changeset patch # User Kim Alvefur # Date 1558625878 -7200 # Node ID 7811ba4675259a4e645d89db54a0f631c7c6a59c # Parent 452ae6effd02a3c80dbf5e0a92a736749603dad1 mod_extdisco: Remove redundant condition These tags are guaranteed to exist by stanza routing diff -r 452ae6effd02 -r 7811ba467525 mod_extdisco/mod_extdisco.lua --- a/mod_extdisco/mod_extdisco.lua Thu May 23 17:34:49 2019 +0200 +++ b/mod_extdisco/mod_extdisco.lua Thu May 23 17:37:58 2019 +0200 @@ -11,7 +11,7 @@ local function handle_services(event) local origin, stanza = event.origin, event.stanza; local service = stanza.tags[1]; - local service_type = service and service.attr.type; + local service_type = service.attr.type; local reply = st.reply(stanza):tag("services", { xmlns = service.attr.xmlns }); for host, service_info in pairs(services) do if not(service_type) or service_info.type == service_type then @@ -34,7 +34,7 @@ local function handle_credentials(event) local origin, stanza = event.origin, event.stanza; local credentials = stanza.tags[1]; - local host = credentials and credentials.attr.host; + local host = credentials.attr.host; if not host then origin.send(st.error_reply(stanza, "cancel", "bad-request", "No host specified")); return true;