diff --git a/rpcapi/api/contract_v2.go b/rpcapi/api/contract_v2.go index 6130ecf07..4e75f3e17 100644 --- a/rpcapi/api/contract_v2.go +++ b/rpcapi/api/contract_v2.go @@ -438,7 +438,7 @@ func (r *ContractApi) GetSBPRewardPendingWithdrawal(name string) (*SBPReward, er return nil, err } if info == nil { - return nil, nil + return nil, util.ErrSBPNotExists } sb, err := db.LatestSnapshotBlock() if err != nil { @@ -507,6 +507,9 @@ func (r *ContractApi) GetSBP(name string) (*SBPInfo, error) { if err != nil { return nil, err } + if info == nil { + return nil, util.ErrSBPNotExists + } sb, err := db.LatestSnapshotBlock() if err != nil { return nil, err diff --git a/vm/contracts/abi/abi_gonvernance.go b/vm/contracts/abi/abi_gonvernance.go index 21b777987..4c64c7f73 100644 --- a/vm/contracts/abi/abi_gonvernance.go +++ b/vm/contracts/abi/abi_gonvernance.go @@ -363,7 +363,7 @@ func GetRegistration(db StorageDatabase, gid types.Gid, name string) (*types.Reg return nil, err } if len(value) == 0 { - return nil, util.ErrSBPNotExists + return nil, nil } return UnpackRegistration(value)