From ad9cd1933ae08ff2b6c083bda2993a50fa01d0b5 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 22 Feb 2021 08:28:34 -0600 Subject: [PATCH] Add nil check for validator db migration (#8493) * Add nil check for validator db migration * continue if source bucket is nil --- validator/db/kv/migration_source_target_epochs_bucket.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/validator/db/kv/migration_source_target_epochs_bucket.go b/validator/db/kv/migration_source_target_epochs_bucket.go index 14456360f..d061c79bd 100644 --- a/validator/db/kv/migration_source_target_epochs_bucket.go +++ b/validator/db/kv/migration_source_target_epochs_bucket.go @@ -51,9 +51,12 @@ func (s *Store) migrateSourceTargetEpochsBucketUp(ctx context.Context) error { bkt := tx.Bucket(pubKeysBucket) for _, pubKey := range batch { pkb := bkt.Bucket(pubKey) + if pkb == nil { + continue + } sourceBucket := pkb.Bucket(attestationSourceEpochsBucket) if sourceBucket == nil { - return nil + continue } targetBucket, err := pkb.CreateBucketIfNotExists(attestationTargetEpochsBucket) if err != nil {