mod_rest: Fix traceback
Might have been caused by receiving a stanza here. Otherwise how could
there be an util.error object without .context ?
--- a/mod_rest/mod_rest.lua Tue Feb 04 22:06:19 2020 +0100
+++ b/mod_rest/mod_rest.lua Tue Feb 04 22:22:47 2020 +0100
@@ -143,7 +143,7 @@
return encode(send_type, result.stanza);
end,
function (error)
- if error.context.stanza then
+ if error.context and error.context.stanza then
response.headers.content_type = send_type;
module:log("debug", "Sending[rest]: %s", error.context.stanza:top_tag());
return encode(send_type, error.context.stanza);