1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-10 18:10:54 +09:00

Fix sync tree close

This commit is contained in:
mcrakhman 2024-02-14 22:19:17 +01:00
parent c16812df55
commit 8ad16df17f
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B

View file

@ -4,9 +4,13 @@ import (
"context"
"errors"
"fmt"
"github.com/anyproto/any-sync/commonspace/deletionmanager"
"github.com/anyproto/any-sync/util/crypto"
"github.com/gogo/protobuf/proto"
"go.uber.org/zap"
"github.com/anyproto/any-sync/accountservice"
"github.com/anyproto/any-sync/app/logger"
"github.com/anyproto/any-sync/commonspace/object/tree/objecttree"
@ -18,8 +22,6 @@ import (
"github.com/anyproto/any-sync/commonspace/spacestorage"
"github.com/anyproto/any-sync/commonspace/spacesyncproto"
"github.com/anyproto/any-sync/nodeconf"
"github.com/gogo/protobuf/proto"
"go.uber.org/zap"
)
var log = logger.NewNamed("common.commonspace.settings")
@ -166,7 +168,10 @@ func (s *settingsObject) checkHistoryState(ctx context.Context) (err error) {
}
func (s *settingsObject) Close() error {
return s.SyncTree.Close()
if s.SyncTree != nil {
return s.SyncTree.Close()
}
return nil
}
var isDerivedRoot = objecttree.IsDerivedRoot