# HG changeset patch # User Kim Alvefur # Date 1616080665 -3600 # Node ID a2ba6c0ac8ece375dc3426d01d5006b77da3373c # Parent cab64a0aad49578f3bc8e6c7ae60157adfc5c176 mod_saslauth: Improve code style This many returns deserve their own line. `session["sasl_handler"]` style isn't used anywhere else. diff -r cab64a0aad49 -r a2ba6c0ac8ec plugins/mod_saslauth.lua --- a/plugins/mod_saslauth.lua Thu Mar 18 16:24:46 2021 +0100 +++ b/plugins/mod_saslauth.lua Thu Mar 18 16:17:45 2021 +0100 @@ -44,7 +44,9 @@ end local function handle_status(session, status, ret, err_msg) - if session["sasl_handler"] == nil then return "failure", "connection-timeout", "Connection gone"; end + if not session.sasl_handler then + return "failure", "connection-timeout", "Connection gone"; + end if status == "failure" then module:fire_event("authentication-failure", { session = session, condition = ret, text = err_msg }); session.sasl_handler = session.sasl_handler:clean_clone();