Skip to content

Commit

Permalink
Add nil check for validator db migration (#8493)
Browse files Browse the repository at this point in the history
* Add nil check for validator db migration

* continue if source bucket is nil
  • Loading branch information
prestonvanloon authored Feb 22, 2021
1 parent 0f51578 commit ad9cd19
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion validator/db/kv/migration_source_target_epochs_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ad9cd19

Please sign in to comment.