Skip to content

Commit 8cdb31e

Browse files
author
Olivier Bonnaure
committed
fix: YieldContent issue when no data
1 parent 406f561 commit 8cdb31e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.lua/luaonbeans.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,18 @@ end
105105

106106
---Helper method ContentFor
107107
---@param tag string name of the content
108-
---@param fn function the function to be executed
108+
---@param block function the function to be executed
109109
---@return nil
110110
function ContentFor(tag, block)
111-
Blocks[tag] = Blocks[tag] or {}
112-
table.insert(Blocks[tag], block())
111+
Blocks[tag] = Blocks[tag] or {}
112+
table.insert(Blocks[tag], block())
113113
end
114114

115115
---Helper method YieldContent
116116
---@param tag string name of the content
117117
---@return string content
118118
function YieldContent(tag)
119-
return table.concat(Blocks[tag], "\n")
119+
return table.concat(Blocks[tag] or {}, "\n")
120120
end
121121

122122
local function assignRoute(method, name, options, value)

0 commit comments

Comments
 (0)