ignore sync if sync service is nil

This commit is contained in:
c9s 2021-02-28 15:05:49 +08:00
parent 4730efefa3
commit b71ea867c5

View File

@ -506,6 +506,10 @@ func (environ *Environment) setSyncing(status SyncStatus) {
// Sync syncs all registered exchange sessions
func (environ *Environment) Sync(ctx context.Context) error {
if environ.SyncService == nil {
return nil
}
environ.syncMutex.Lock()
defer environ.syncMutex.Unlock()