mod_rest: Fix attempt at indexing nil if an error stanza is missing <error>
authorKim Alvefur <zash@zash.se>
Sun, 15 Nov 2020 16:31:08 +0100
changeset 4255 d33b480befcb
parent 4254 8b489203e4d3
child 4256 1327e1e1c94e
mod_rest: Fix attempt at indexing nil if an error stanza is missing <error>
mod_rest/jsonmap.lib.lua
--- a/mod_rest/jsonmap.lib.lua	Sun Nov 15 16:29:48 2020 +0100
+++ b/mod_rest/jsonmap.lib.lua	Sun Nov 15 16:31:08 2020 +0100
@@ -467,7 +467,7 @@
 			type = err_typ,
 			condition = err_condition,
 			text = err_text,
-			by = error.attr.by,
+			by = error and error.attr.by or nil,
 		};
 		return t;
 	end