Software /
code /
prosody-modules
Changeset
2910:415455faccae
mod_inject_ecaps2: Return if calculating the hash failed
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 07 Mar 2018 20:13:48 +0100 |
parents | 2909:1d6bec35b752 |
children | 2911:43adc18ff9f3 |
files | mod_inject_ecaps2/mod_inject_ecaps2.lua |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_inject_ecaps2/mod_inject_ecaps2.lua Wed Mar 07 19:40:20 2018 +0100 +++ b/mod_inject_ecaps2/mod_inject_ecaps2.lua Wed Mar 07 20:13:48 2018 +0100 @@ -71,7 +71,11 @@ return; end - local extension_string = calculate_hash(disco_info); + local extension_string, err = calculate_hash(disco_info); + if extension_string == nil then + module:log("warn", "Failed to calculate ecaps2 hash: %s", err) + return; + end local ecaps2 = st.stanza("c", { xmlns = "urn:xmpp:caps" }); for algo in algorithms do