1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-09 09:35:00 +09:00

GO-1367: fix

This commit is contained in:
AnastasiaShemyakinskaya 2023-04-25 18:17:59 +02:00 committed by Mikhail Iudin
parent 47697b8860
commit 2b7d616633
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0

View file

@ -424,12 +424,18 @@ func (p *Pb) getIDForSubObject(sn *pb.SnapshotWithType, id string) string {
// cleanupEmptyBlockMigration is fixing existing pages, imported from Notion
func (p *Pb) cleanupEmptyBlock(snapshot *pb.SnapshotWithType) {
var (
emptyBlock *model.Block
)
for _, block := range snapshot.Snapshot.Data.Blocks {
if block.Content == nil {
block.Content = &model.BlockContentOfSmartblock{
Smartblock: &model.BlockContentSmartblock{},
}
break
emptyBlock = block
} else if block.GetSmartblock() != nil {
return
}
}
if emptyBlock != nil {
emptyBlock.Content = &model.BlockContentOfSmartblock{Smartblock: &model.BlockContentSmartblock{}}
}
}