If the snapshot is nil, newContractROState returns nil instead of nil value
If newContractROState returns nil value, the caller will not know whether it's nil.
@@ -207,5 +207,8 @@ func (c *contractROState) SetStatus(state ContractState) {
}
func newContractROState(snapshot ContractSnapshot) Contract {
+ if snapshot == nil {
+ return nil
+ }
return &contractROState{snapshot}
}
