Fix nil access on term snapshot
@@ -241,12 +241,13 @@ func (s *chainScore) handleRevisionChange(as state.AccountState, r1, r2 int) err
if r1 < icmodule.RevisionSetIRepViaNetworkProposal && r2 >= icmodule.RevisionSetIRepViaNetworkProposal {
if irep := es.State.GetIRep(); irep.Sign() == 0 {
- term := es.State.GetTermSnapshot()
+ if term := es.State.GetTermSnapshot(); term != nil {
if err := es.State.SetIRep(term.Irep()); err != nil {
return err
}
}
}
+ }
// It's handled in governanceHandler.handleRevisionChange
// if r1 < icmodule.RevisionFixInvalidUnstake && r2 >= icmodule.RevisionFixInvalidUnstake {
