Skip to content

Commit

Permalink
fix nil bug
Browse files Browse the repository at this point in the history
  • Loading branch information
treeder authored Oct 6, 2023
1 parent 9eea5b8 commit 1d7b66c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rend.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export class Rend {
// console.log("render", bodyFunc)

let o = this.options
if (!d) d = {}
if (this.options.data) {
d = { ...o.data, ...d }
}

let b = await this.renderBody(bodyFunc, d)

Expand All @@ -33,10 +37,6 @@ ${o.footer ? o.footer(d) : ''}
}

async renderBody(bodyFunc, d) {
if (!d) d = {}
if (this.options.data) {
d = { ...this.options.data, ...d }
}
let b
// console.log("typeof bodyFunc", typeof bodyFunc)
if (!bodyFunc) {
Expand Down

0 comments on commit 1d7b66c

Please sign in to comment.