Changeset

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 (2020-11-15)
parents 4250:8b489203e4d3
children 4252:1327e1e1c94e
files mod_rest/jsonmap.lib.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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