Skip to content

Commit 8ffc309

Browse files
committed
update
1 parent aa61ba3 commit 8ffc309

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

middleware/tplfunc/tplfunc.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ func UnicodeDecode(str string) string {
359359
// It returns the JSON string representation of the value.
360360
// The indents parameter specifies the indentation string to use (e.g., " " for two spaces).
361361
func JSONEncode(s any, indents ...string) string {
362+
if s == nil {
363+
return ``
364+
}
362365
r, _ := com.JSONEncode(s, indents...)
363366
return string(r)
364367
}

0 commit comments

Comments
 (0)