changeset 3606:7811ba467525

mod_extdisco: Remove redundant condition These tags are guaranteed to exist by stanza routing
author Kim Alvefur <zash@zash.se>
date Thu, 23 May 2019 17:37:58 +0200
parents 452ae6effd02
children 3a06b0b6ba67
files mod_extdisco/mod_extdisco.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;