Add nil check for validator db migration (#8493)

* Add nil check for validator db migration

* continue if source bucket is nil
This commit is contained in:
Preston Van Loon 2021-02-22 08:28:34 -06:00 committed by GitHub
parent 0f515784d8
commit ad9cd1933a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {