From 8a96854733732892aba66cd153e74d24f5e6bf95 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 11 Jul 2024 15:04:29 +0200 Subject: util.xtemplate: Fix error on applying each() to zero stanzas --- spec/util_xtemplate_spec.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'spec/util_xtemplate_spec.lua') diff --git a/spec/util_xtemplate_spec.lua b/spec/util_xtemplate_spec.lua index 4561378e..421be43f 100644 --- a/spec/util_xtemplate_spec.lua +++ b/spec/util_xtemplate_spec.lua @@ -38,6 +38,10 @@ describe("util.xtemplate", function () x:reset(); assert.same("12345", xtemplate.render("{foo/bar|each(i){{#}}}", x)); end) + it("handles missing inputs", function () + local x = st.stanza("root"); + assert.same("", xtemplate.render("{foo/bar|each(i){{#}}}", x)); + end) end) end) end) -- cgit v1.2.3