Don't write nil when saving blocks
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
93e10f5272
commit
3609b5020f
4
file.go
4
file.go
|
@ -132,7 +132,7 @@ func NewFilePages(dirname string, index bleve.Index) PagesRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
func convertBlocksToListItems(current string, blocks BlockResponse, indent int) []ActualListItem {
|
func convertBlocksToListItems(current string, blocks BlockResponse, indent int) []ActualListItem {
|
||||||
var listItems []ActualListItem
|
listItems := []ActualListItem{}
|
||||||
|
|
||||||
for _, child := range blocks.Children[current] {
|
for _, child := range blocks.Children[current] {
|
||||||
l := convertBlocksToListItems(child, blocks, indent+1)
|
l := convertBlocksToListItems(child, blocks, indent+1)
|
||||||
|
@ -350,7 +350,7 @@ func saveBlocksFromPage(dirname string, page Page) error {
|
||||||
prevList[parent.ID] = parent
|
prevList[parent.ID] = parent
|
||||||
blocks[parent.ID] = Block{
|
blocks[parent.ID] = Block{
|
||||||
Text: title,
|
Text: title,
|
||||||
Children: nil,
|
Children: []string{},
|
||||||
Parent: root,
|
Parent: root,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user