Diff

mod_rest/jsonmap.lib.lua @ 4251:d33b480befcb

mod_rest: Fix attempt at indexing nil if an error stanza is missing <error>
author Kim Alvefur <zash@zash.se>
date Sun, 15 Nov 2020 16:31:08 +0100
parent 4035:270cd50852be
child 4309:e8b9228b5265
line wrap: on
line diff
--- 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