Check nil condition of contract when updating
fix
@@ -339,7 +339,9 @@ func (h *DeployHandler) DoExecuteSync(cc CallContext) (error, *codec.TypedObj, m
h.FID, as.ContractOwner(), h.From)
return scoreresult.ErrAccessDenied, nil, nil
}
- if contract := as.Contract(); !h.eeType.AbleToUpdate(contract.EEType()) {
+ if contract := as.Contract(); contract == nil {
+ return scoreresult.InvalidParameterError.Errorf("ProhibitToUpdate(NotActive)"), nil, nil
+ } else if !h.eeType.AbleToUpdate(contract.EEType()) {
return scoreresult.InvalidParameterError.Errorf("ProhibitToUpdate(old=%s,new=%s)",
contract.EEType(), h.eeType), nil, nil
}
