refactor: Add default BuildContext if none provided in TranslateMarks function
This commit is contained in:
parent
61205ced5f
commit
a5e1b569be
1 changed files with 4 additions and 0 deletions
|
|
@ -290,6 +290,10 @@ func (page *Page) TranslateMarks(ctx *BuildContext, option *BuildOption, doc *go
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ctx == nil {
|
||||||
|
ctx = NewBuildContext(nil)
|
||||||
|
}
|
||||||
|
|
||||||
if ctx.translations == nil {
|
if ctx.translations == nil {
|
||||||
ctx.translations = []Translation{}
|
ctx.translations = []Translation{}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue