mod_rest/mod_rest.lua
changeset 3883 3b31ff7b4c7c
parent 3880 75b330d4fa6f
child 3891 3d0e8e32453c
--- 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);