Software /
code /
prosody-modules
Diff
mod_inject_ecaps2/mod_inject_ecaps2.lua @ 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 |
parent | 2909:1d6bec35b752 |
child | 2913:3fb4f72b3dfd |
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