Skip to content

Commit e810040

Browse files
committed
fix
1 parent 1db3d6f commit e810040

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

x/compute/internal/keeper/migrations.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,13 @@ func (m Migrator) Migrate3to4(ctx sdk.Context) error {
111111
var brokenContractKey types.BrokenContractKey
112112
err := m.keeper.cdc.Unmarshal(brokenContractKeyBz, &brokenContractKey)
113113
if err == nil {
114-
fixedContractKey := types.ContractKey{
115-
OgContractKey: brokenContractKey.OgContractKey.OgContractKey,
116-
CurrentContractKey: brokenContractKey.CurrentContractKey.CurrentContractKey,
117-
CurrentContractKeyProof: brokenContractKey.CurrentContractKeyProof,
114+
var fixedContractKey types.ContractKey
115+
if brokenContractKey.OgContractKey != nil && brokenContractKey.CurrentContractKey != nil {
116+
fixedContractKey = types.ContractKey{
117+
OgContractKey: brokenContractKey.OgContractKey.OgContractKey,
118+
CurrentContractKey: brokenContractKey.CurrentContractKey.CurrentContractKey,
119+
CurrentContractKeyProof: brokenContractKey.CurrentContractKeyProof,
120+
}
118121
}
119122

120123
m.keeper.SetContractKey(ctx, contractAddress, &fixedContractKey)

0 commit comments

Comments
 (0)